Re: [PHP] storing japanese in mysql (or pgsql)

From: - Edwin - (copperwa11s_at_yahoo.co.jp)
Date: 10/01/03


Date: Wed, 1 Oct 2003 10:59:57 +0900
To: "Chris W. Parker" <cparker@swatgear.com>

Hi,

"Chris W. Parker" <cparker@swatgear.com> wrote:

> (I posted this to another list yesterday without response, so if it
> looks familiar, that's why.)
>
> Hi.
>
> I'm working on a small study aid for myself (and anyone else that wants
> to use it) and I could really use the ability to store Japanese
> characters in a MySQL or pgsql db. Right now I've created a very large
> array.
>
> What I'd like to do is have a form that will allow me to add new
> characters whenever needed. So far my attempts at this have failed. It
> always seems that the extended characters get turned into their html
> entity equivalents before they are inserted into the db.

What exactly do you mean by "extended characters"? And, do you mean all *other* characters are inserted properly? Anyway,...

> I'm using euc-jp as the character set.
>
> I'm pretty much lost with this. Anyone have experience with this that
> they'd like to share? (on or off list is fine.)
>

Well, setting the "default-character-set" to "ujis" for both the server and the client works for me.

First check your "characterset"(s):

  mysql> status

If they're not "ujis" (for euc-jp), add this to your "my.cnf" file: (Under [mysqld] and [client])

  default-character-set = ujis

Restart your servers.

Btw, check your php.ini as well and make sure that your settings under [mbstring] are correct.

HTH,

- E -
__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/



Relevant Pages

  • Re: [PHP] magic_quotes
    ... backslashes as if it were ASCII data, and it may *NOT* be ASCII data. ... That would lead to $_POST data like Jingle's Bells to be passed as ... You do *NOT* use stripslasheson the data coming OUT of MySQL. ... The whole point of this escaping is to identify characters that MySQL ...
    (php.general)
  • Re: [PHP] magic_quotes
    ... backslashes as if it were ASCII data, and it may *NOT* be ASCII data. ... That would lead to $_POST data like Jingle's Bells to be passed as ... You do *NOT* use stripslasheson the data coming OUT of MySQL. ... The whole point of this escaping is to identify characters that MySQL ...
    (php.general)
  • Re: Allowing special characters in a MySql Database
    ... I originally thought it was MySQL stripping them out but I did a ... actually removing the characters when i hit the submit button though. ... > php has an escape function specifically for mySQL inserts ...
    (microsoft.public.dotnet.general)
  • Re: Information about character lost from MySQL to Access
    ... Connector/ODBC driver 3.51.* as it is seen on ... In the Access are now in the from MySQL linked tables the right special ... characters instead of questionmarks before. ...
    (microsoft.public.access.externaldata)
  • Re: Information about character lost from MySQL to Access
    ... Connector/ODBC driver 3.51.* as it is seen on ... In the Access are now in the from MySQL linked tables the right special ... characters instead of questionmarks before. ...
    (microsoft.public.access.externaldata)