Re: [PHP] Japanese entry into MySQL and into emails

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


Date: Thu, 30 Oct 2003 23:13:20 +0900
To: "Dave G" <ml@autotelic.com>

Hi,

On 2003.10.30, at 18:11 Asia/Tokyo, Dave G wrote:

> PHP Gurus,
> Hello, I'm new to this list. I'm very much new to PHP, so my
> questions will be very basic.
> I have two things I need to do in Japanese:
>
> 1. Store people's names in kanji in my MySQL database.
> To this end, I've set up an INSERT command without doing
> anything different than usual, and then at the HTML interface, just
> typed in some Japanese text (on an English Windows XP machine, Opera
> 7.2, using Microsoft's global IME text entry). When I looked in my
> database via phpMyAdmin, the field looked like it was filled with ASCII
> gibberish.

Most probably, you're using phpMyAdmin in English. Choose "EUC-JP" when
entering or viewing data.

> 2. Send kanji text via PHPs mail() command.
> I've set up a form on a web page, that posts to a PHP script
> that will send me feedback from the users. Again, I didn't set up
> anything different than I would for English usage. When I received the
> mail, it came out as ASCII gibberish again.

Have you tried the examples here?

   http://jp2.php.net/manual/en/function.mb-send-mail.php

> I've searched some on the web, and in this lists archives, and I
> understand that I can possibly use mbstring functions in order to
> resolve this. However, the manual for this function on php.net is a
> little beyond my ability to understand it. I'm confused by the need to
> set "internal encoding", and/or also setting the "character set". My
> web
> site is on a virtual host, and I don't know if I have access to make
> such adjustments.
>
> Can someone please explain in beginners terms how do I set up my
> PHP scripts to enter Japanese kanji safely into a database and into an
> email?

You'll find some info about "internal encoding" here:

And, you'll be able to set the values by using this:

   http://jp2.php.net/manual/en/function.ini-set.php

Make sure to read this as well:

   http://jp2.php.net/manual/en/configuration.changes.php

- E -

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



Relevant Pages

  • Re: OT -- good news compilation website
    ... Sort of like My Yahoo, ... UK listed first as you cited Reuters ... Many international TV news casts [in english or with english ... and wisdom and counsel shall not alter them to the better, ...
    (rec.crafts.metalworking)
  • Re: Unlikely Verbs Arising Spontaneously
    ... You haven't cited a first complaint, ... That is, yahoo, saran wrap, xeroxes, kleenex and the like are all ... So 3M isn't likely to come up in English. ... of course, it's a paid advertisement,'' unless it's a paid advertisement. ...
    (sci.lang)
  • Fw: Van Wagenen
    ... Subject: news in English ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (soc.genealogy.benelux)
  • Re: Need Birth/Death reference 1940s - JACKSON
    ... Back to sending attachments to the list are you, Hugh. ... > matter how the English ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (soc.genealogy.britain)