php-i18n Digest 6 Apr 2004 23:27:48 -0000 Issue 224

Topics (messages 683 through 685):

Re: Script to convert utf-8 to html entities?
        683 by: Amadeus

Particular Problem Kanji
        684 by: Claire Hector
        685 by: Claire Hector

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
> A> I have been having a lot of problems with .po 's in utf-8 on linux 
> A> systems...
> 
> A> A solution to incorrect displays would be to convert the .po content into
> A> html_entities (&#xxxx).
> 
> You can use mb_convert_encoding();
> 
> Tis an example:
> <?php
> $data = file_get_contents('in.po');
> $data = mb_convert_encoding($data, 'HTML-ENTITIES', 'UTF-8');
> $fp = fopen('out.po', 'wb');
> fwrite($fp, $data);
> fclose($fp);
> ?>

Just what I was looking for. I was missing mbstring on this box but it 
works fine now.

Thanks again!

Amadeus

-- 
[EMAIL PROTECTED]
SDF Public Access UNIX System - http://sdf.lonestar.org

--- End Message ---
--- Begin Message ---
Hello!
I have a question regarding some particular Japanese words.

I have a MySQL database and have set the character set for selected
tables to sjis (I have also tried this with ujis and various php
settings)

php.ini settings for mbstring are as follows:

     mbstring.language=Japanese
     mbstring.internal_encoding=SJIS
     mbstring.http_input=auto
     mbstring.http_input=UTF-8
     mbstring.encoding_translation=on
     mbstring.detect_order=auto
     mbstring.substitute_character=none

[the server was configured by our network person so i am not 100% sure
of the reasoning behind these particular settings.]

The server is Apache using an additional module for Japanese from webDAV
called mod_encoding
with ServerEncoding set to utf-8 & DefaultClientEncoding as
JA-AUTO-SJIS-MS

Each page is encoded as shift_jis. (i have also played around with these
and the get the same problems if this is changes to utf-8 or euc-jp)

Generally, the html pages display Japanese without problem, however
there are a couple of particular kanji that do not display properly.
When entered into a html form they look fine, when the query the data is
used for is echoed back to the screen all is fine, but once they are
actually entered into the MySQL database they change.

Examples of problem kanji...
yo-so-ku -> when this is stored in the database it changes to the kanji
for egg and a small katakana i...
yo-so-u  -> when this is stored in the database it changes to the kanji
for egg and a small z...
also
ko-u-chi-ku
ju-u-bu-n
hyo-u-to
hyo-u-sho-u

Can this be changed by altering the encoding scheme chosen or are these
particular problem kanji and should just be avoided?


I would really appreciate your expertise in helping me make sense of
this.
Thanks,
Claire

--- End Message ---
--- Begin Message ---
Does anyone have any ideas on this?

Cheers,
Claire

--- End Message ---

Reply via email to