mwanji / essayist

A blogging app for the tent.io protocol
10 stars 2 forks source link

unicode text not working #23

Closed vrypan closed 11 years ago

vrypan commented 11 years ago

unicode text is scrambled. Here is an example: http://essayist.mndj.me/vrypan.tent.is/essay/be6q3l The characters in the title and body (in the parenthesis) should be Greek, but are scrambled. This is usually the case with unicode text treated as ASCII at some point in the code.

mwanji commented 11 years ago

Could you send me some unscrambled greek so I can test this locally? If github accepts unicode, then just as a comment or a gist.

BTW, I'm using greek in the navbar (an alpha) and the anchor on the essay page is unicode.

vrypan commented 11 years ago

Greek unicode:

ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ αβγδεζηθικλμνξοπρστυφχψω Αυτό είναι το ελληνικό αλφάβητο.

The final output (HTML) is unicode. But it looks like at some point, your code treated a unicode string as ASCII ( treating, more or less, 2-byte characters as 2 single-byte characters)

mwanji commented 11 years ago

I have Unicode working beautifully locally, but still having problems when I deploy it... Still investigating.

vrypan commented 11 years ago

Sometimes it's the DB settings (or the DB connector, or something?). I have no java experience, but if this is the case, make sure that the locale settings are the same between your local installation and the production environment.

mwanji commented 11 years ago

I'm not storing the essays in my database, but maybe my host is using a different default encoding for its JVM.

mwanji commented 11 years ago

This should be resolved now.

http://essayist.mndj.me/vrypan.tent.is/essay/be6q3l looks good.

vrypan commented 11 years ago

It works. Thank you!