Inserting Japanese characters into UTF-8 MySQL database via php
am 31.07.2006 22:02:14 von Marcin
I have problems with inserting Japanese chars into MySQL database. This
operation results in two completetely different strings that I can see
via phpMyAdmin:
$word: SELECT word FROM table;
INSERT $word INTO table;
Both commands are executed direclty via PHP, phpMyAdmin shows the
original word (inserted into table via phpMyAdmin) correctly and a
wrong copy (f.e. %&c/#....) of word inserted via PHP.
I preasume that the problem is PHP default coding, I tried to convert
encoding to UTF-8 by mb_convert_encoding($key, "UTF-8", "auto"); with
no success.
Re: Inserting Japanese characters into UTF-8 MySQL database via php
am 01.08.2006 06:00:52 von Shion
marcin@netsign.pl wrote:
Please, quite multi-posting, if you have to ask the same thing on more than
one newsgroup, then cross-post to 2-4 newsgroups and see to that all of them
are relevant.
> I have problems with inserting Japanese chars into MySQL database. This
> operation results in two completetely different strings that I can see
> via phpMyAdmin:
> $word: SELECT word FROM table;
> INSERT $word INTO table;
>
> Both commands are executed direclty via PHP, phpMyAdmin shows the
> original word (inserted into table via phpMyAdmin) correctly and a
> wrong copy (f.e. %&c/#....) of word inserted via PHP.
>
> I preasume that the problem is PHP default coding, I tried to convert
> encoding to UTF-8 by mb_convert_encoding($key, "UTF-8", "auto"); with
> no success.
>
See to that your PHP is compiled with the mbstring option enabled.
//Aho
Re: Inserting Japanese characters into UTF-8 MySQL database via php
am 01.08.2006 06:00:52 von Shion
marcin@netsign.pl wrote:
Please, quite multi-posting, if you have to ask the same thing on more than
one newsgroup, then cross-post to 2-4 newsgroups and see to that all of them
are relevant.
> I have problems with inserting Japanese chars into MySQL database. This
> operation results in two completetely different strings that I can see
> via phpMyAdmin:
> $word: SELECT word FROM table;
> INSERT $word INTO table;
>
> Both commands are executed direclty via PHP, phpMyAdmin shows the
> original word (inserted into table via phpMyAdmin) correctly and a
> wrong copy (f.e. %&c/#....) of word inserted via PHP.
>
> I preasume that the problem is PHP default coding, I tried to convert
> encoding to UTF-8 by mb_convert_encoding($key, "UTF-8", "auto"); with
> no success.
>
See to that your PHP is compiled with the mbstring option enabled.
//Aho