Japanese characters and utf-8

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Mangek
Regular
Posts: 85
Joined: Tue Jun 24, 2008 1:08 am
Location: Sweden
Contact:

Japanese characters and utf-8

Post by Mangek »

Hey there,

I've been looking around for a bit, searching both this forum and google for a possible answer.

I'm currently learning Japanese, and I wanted to write about my progress (have a look here). The problem I'm having is that the characters won't turn out right. The ?'s you see there at the end of the post are meant to be the first five letters in the basic hiragana (image on the right).

Now, a search in this forum gave me this post, and this user seems to be able to mix English and Japanese quite well (even though it's mostly in Japanese, I suppose), and I see he's also using utf-8.

So what could my problem be?

Edit: I just realised I'm not running the latest version, so will upgrade and see if that helps any. :]

Edit2: When I launched phpMyAdmin I got this message:
The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.
Maybe that's the problem, or does that only affect phpMyAdmin operations?

Edit3: Ok, so I just upgraded to latest version and that didn't help. Ruling out the fact that both the blog front- and back-end run with iso-8 I'm thinking it probably have something to do with the data being inserted in mySQL, so I'm thinking there has to be a way to change the charset there, right?

Edit4: I'm writing a novel here, hehe. Ok I had a look in phpMyAdmin and apparently the charset is utf-8 there as well, so I'm all out of ideas.

Edit5: It's solved! I initially just changed the charset on phpMyAdmin's front page, but later noticed that all the tables and various this and that (don't know the terminology hehe) was set to latin_swedish, so I just changed the one for serendipity_entries and the Japanese chars are now showing! :) (I feel so proud, managed to dig through this without ruining anything this time ;) )
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Japanese characters and utf-8

Post by garvinhicking »

Hi!

You need to go to your serendipity configuration panel and set the Charset there to "UTF-8" (instead of 'native').You might also need to enable the option "Use database charset" in the DB section of the configuration, so thats9y issues UTF-8 connections to MySQL.

Once you did that, you should beableto create new entrieswith UTF-8 (old entries will still show up wrong, you need to manually edito those again)

HTH,
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/
Mangek
Regular
Posts: 85
Joined: Tue Jun 24, 2008 1:08 am
Location: Sweden
Contact:

Post by Mangek »

Both of them have been enabled all the time. I'm thinking something went wrong when I initially created the database though, and it ended up as swedish_latin.

But it works now, after I changed serendipity_entries to utf-8. :)
Post Reply