Forum Moderators: open

Message Too Old, No Replies

Japanese sjis in mysql

japanese, sjis, mysql , php

         

phpfreak

11:30 am on Jan 24, 2007 (gmt 0)

10+ Year Member



hello,

I'm trying to make a japanese website using php and mysql.
I've created tables using phpmyadmin with sjis_japanese_ci as collation. But when i insert data(text) from from(pages are using shift_jis charset) i see?s? (some weird characters) in phpmyadmin.
But if i insert data in a blob feild the data shows properly when i display it in a page. Then i changed the feild from blob to text, the japanese text was displayed properly.

how do i store sjis data in mysql and display it?

Please help
Thanks

bill

12:34 am on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There have been reports of Shift_JIS being problematic with PHP. There are ways to get Shift_JIS to work:

Need to make page in Japanese [webmasterworld.com]

We have done some basic stuff with MySQL and php. We used Shift-JIS. The trick seemed to be getting the data into the data base in the Shift-JIS format.

We found if you run MyphpAdmin in japanese (s-JIS) and then do a text import (selecting the Shift-JIS encoding) it works fine.

phpfreak

9:40 am on Jan 29, 2007 (gmt 0)

10+ Year Member



hello bill,
thanks for replying,

i had used utf8 earlier for another website and it worked fine, now i want to use sjis, i have to get data from form and store in mysql,pages are in shift_jis encoding, but when i try to save it in mysql i get weird characters,
eg:
$sql = 'INSERT INTO tb1 (last_name) VALUES ("マーチ支店")';

i get "?}?[?`?x店"

When i use phpmyadmin it works fine, if i change it to blob feild it works fine. if i change it to blob, insert data and then change to text it shows properly.

please help.
Thanks