Request for Unicode

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Guest007

Request for Unicode

Post by Guest007 »

Is there any chance the new 0.8 version of serendipity will give us full utf8 support (even without having iconv installed)?

stephan
tadpole
Regular
Posts: 88
Joined: Fri Oct 08, 2004 6:20 am
Location: 33°6'4.079" North, 117°3'6.563" West
Contact:

Post by tadpole »

I was thinking about this, and I think it would be possible to create a native-PHP drop-in replacement for iconv using the LDML data over at the CLDR. We could, of course, convert to a more disk-space friendly format. What does everyone else think?

Migrating to UTF-8 is an extremely nice thing to do, I'm just not sure how best to go about it. I'm going to take this to the mailing list so we can have a nice healty flame-war ;)
Guest007

Post by Guest007 »

Well, others are considering it as well, maybe you can benefit from their mistakes :-)
Have a look at Alex' attempts to move over otf-8: http://www.alexking.org/blog/2004/11/08 ... -to-utf-8/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hm, isn't it as easy as:

1. Editing the language file you're using, set the CHARSET to UTF8
2. Switch your database engine to store in UTF8 format
3. Make your browser create UTF8 input

No recoding necessary...?

Regards,
Garvin.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tadpole
Regular
Posts: 88
Joined: Fri Oct 08, 2004 6:20 am
Location: 33°6'4.079" North, 117°3'6.563" West
Contact:

Post by tadpole »

For new blogs its easy. Migrating older blogs is somewhat more complicated because you have to convert charsets (hence the iconv stuff).

Also, I don't think MySQL < 4.1 supports UTF-8... how would we get around that?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

I think giving MySQL 4.1 a bunch of SQL statements with altering tables and collations/charsets should do.

And, well - I am not really for inventing legacy backward-compatibility stuff for "new trends" like "UTF8 everywhere". MySQL 4.1 is already declared stable, so I think we should focus on using this technology instead of looking at the past...that only creates redundancy and performance-drops, whereas MySQL 4.1 really nicely supports all that UTF8 stuff, if properly configured.

</rant> ;)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
CapriSkye
Regular
Posts: 119
Joined: Sun Oct 31, 2004 4:42 am
Location: Taiwan
Contact:

Post by CapriSkye »

i have utf-8 encoding for my chinese blog, everything looks pretty well, except the email notification. it doesn't show up right, changing encoding in my email client doesn't work either. all characters show up ok in the blog though, just not when getting notification about comments and trackbacks. i've seen other post mentioning about htmlentities(), should i change every htmlentities() into htmlspacialchars()? thanks
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Well, we're not using htmlspecialchars() somewhere in that function, so that shouldn't be the problem.

I guess it's a problem because of missing charset language mailheaders. Please try this:

Open serendipity_config.inc.php, find $serendipity['mailheaders'] and change it to:

Code: Select all

/* Default mail headers */
$serendipity['mailheaders'] = 'X-Mailer: Serendipity/'. $serendipity['version'] . "\n"
                            . 'X-Engine: PHP/'. phpversion()
. "\n"
. 'Content-Type: text/plain; charset=' . LANG_CHARSET;
IF this works, please tell me so I can include it in the distro :)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
CapriSkye
Regular
Posts: 119
Joined: Sun Oct 31, 2004 4:42 am
Location: Taiwan
Contact:

Post by CapriSkye »

garvinhicking wrote:Well, we're not using htmlspecialchars() somewhere in that function, so that shouldn't be the problem.

I guess it's a problem because of missing charset language mailheaders. Please try this:

Open serendipity_config.inc.php, find $serendipity['mailheaders'] and change it to:

Code: Select all

/* Default mail headers */
$serendipity['mailheaders'] = 'X-Mailer: Serendipity/'. $serendipity['version'] . "\n"
                            . 'X-Engine: PHP/'. phpversion()
. "\n"
. 'Content-Type: text/plain; charset=' . LANG_CHARSET;
IF this works, please tell me so I can include it in the distro :)

wow garvin you did it again! it's working except the FROM field. any idea? thank you very much
Post Reply