php-i18n Digest 9 Apr 2004 02:59:40 -0000 Issue 225

Topics (messages 686 through 695):

Re: Particular Problem Kanji
        686 by: David Emery
        687 by: Claire Hector
        688 by: David Emery
        689 by: Claire Hector
        690 by: David Emery
        692 by: Claire Hector
        693 by: Claire Hector
        694 by: deltum.deltum.com
        695 by: Leung WC

Re: Changing the Time Zone in php.ini
        691 by: Per Lundkvist

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 ---
2004/04/06 ($B2P(B) 11:58 $B$K(B Claire Hector $B$5$s$O=q$-$^$7$?(B:
(B> Hello!
(B> I have a question regarding some particular Japanese words.
(B> 
(B> I have a MySQL database and have set the character set for selected
(B> tables to sjis (I have also tried this with ujis and various php
(B> settings)
(B> 
(B> php.ini settings for mbstring are as follows:
(B> 
(B>      mbstring.language=Japanese
(B>      mbstring.internal_encoding=SJIS
(B
(BYou shouldn't use SJIS for internal encoding or in your DB, or inside
(Byour PHP. It's evil and will cause exactly the type of problems you're
(Bhaving. I think the mbstring docs explain this. Setting
(Bmbstring.internal_encoding to EUC would be better. UTF is good too, but
(BI don't think it's supported by MySQL. 
(B
(BThere should be an mbstring.http_output setting as well, which you
(Bprobably want to set to SJIS.
(B
(B>      mbstring.http_input=auto
(B>      mbstring.http_input=UTF-8
(B>      mbstring.encoding_translation=on
(B>      mbstring.detect_order=auto
(B>      mbstring.substitute_character=none
(B> 
(B> [the server was configured by our network person so i am not 100% sure
(B> of the reasoning behind these particular settings.]
(B> 
(B> The server is Apache using an additional module for Japanese from webDAV
(B> called mod_encoding
(B> with ServerEncoding set to utf-8 & DefaultClientEncoding as
(B> JA-AUTO-SJIS-MS
(B> 
(B> Each page is encoded as shift_jis. (i have also played around with these
(B> and the get the same problems if this is changes to utf-8 or euc-jp)
(B> 
(B> Generally, the html pages display Japanese without problem, however
(B> there are a couple of particular kanji that do not display properly.
(B> When entered into a html form they look fine, when the query the data is
(B> used for is echoed back to the screen all is fine, but once they are
(B> actually entered into the MySQL database they change.
(B> 
(B> Examples of problem kanji...
(B> yo-so-ku -> when this is stored in the database it changes to the kanji
(B> for egg and a small katakana i...
(B> yo-so-u  -> when this is stored in the database it changes to the kanji
(B> for egg and a small z...
(B> also
(B> ko-u-chi-ku
(B> ju-u-bu-n
(B> hyo-u-to
(B> hyo-u-sho-u
(B> 
(B> Can this be changed by altering the encoding scheme chosen or are these
(B> particular problem kanji and should just be avoided?
(B> 
(B> 
(B> I would really appreciate your expertise in helping me make sense of
(B> this.
(B> Thanks,
(B> Claire
(B-- 
(B-dave

--- End Message ---
--- Begin Message ---
David,
(BThanks for your reply!
(B
(BI am aware that SJIS shouldn't be used for internal coding, however the config
(Bof the server is out of my control and the person who has set it up determined
(Bit was the best setup. It's his rice field ;-) .... i pointed out the very
(Bclear warnings from the php site and he showed me a japanese language site
(Bthat basically justified this setup, so when he wouldn't budge I went and
(Bchanged the config settings in both php and mysql myself to see if this would
(Bfix the problem thus I had:
(B
(BEach page with shift_JIS encoding.
(B
(Bmbstring.language=Japanese
(Bmbstring.internal_encoding=EUC-JP
(Bmbsting.http_output=SJIS
(B
(BMySQL table charater set ujis
(B
(Band Apache using an additional module for Japanese from webDAV called
(Bmod_encoding
(Bwith ServerEncoding set to utf-8 & DefaultClientEncoding as JA-AUTO-SJIS-MS
(B
(Bwith this setup I had real mojibake - none of the japanese on the site
(Bresembled kanji....
(B
(BI have not encountered the webDAV module before and am wondering if this could
(Bbe causing problems. Our network guy said that he needed to use this in order
(Bto get the settings all working, just configuring php as he had also gave
(Bmojibake problems!!
(B
(BIt is quite a frustrating problem as it only effects a few kanji and only once
(Bthey have been sent to mySQL.
(B
(BAny other ideas??
(B
(BCheers,
(BClaire
(B
(BDavid Emery wrote:
(B
(B> 2004/04/06 ($B2P(B) 11:58 $B$K(B Claire Hector $B$5$s$O=q$-$^$7$?(B:
(B> > Hello!
(B> > I have a question regarding some particular Japanese words.
(B> >
(B> > I have a MySQL database and have set the character set for selected
(B> > tables to sjis (I have also tried this with ujis and various php
(B> > settings)
(B> >
(B> > php.ini settings for mbstring are as follows:
(B> >
(B> >      mbstring.language=Japanese
(B> >      mbstring.internal_encoding=SJIS
(B>
(B> You shouldn't use SJIS for internal encoding or in your DB, or inside
(B> your PHP. It's evil and will cause exactly the type of problems you're
(B> having. I think the mbstring docs explain this. Setting
(B> mbstring.internal_encoding to EUC would be better. UTF is good too, but
(B> I don't think it's supported by MySQL.
(B>
(B> There should be an mbstring.http_output setting as well, which you
(B> probably want to set to SJIS.
(B>
(B> >      mbstring.http_input=auto
(B> >      mbstring.http_input=UTF-8
(B> >      mbstring.encoding_translation=on
(B> >      mbstring.detect_order=auto
(B> >      mbstring.substitute_character=none
(B> >
(B> > [the server was configured by our network person so i am not 100% sure
(B> > of the reasoning behind these particular settings.]
(B> >
(B> > The server is Apache using an additional module for Japanese from webDAV
(B> > called mod_encoding
(B> > with ServerEncoding set to utf-8 & DefaultClientEncoding as
(B> > JA-AUTO-SJIS-MS
(B> >
(B> > Each page is encoded as shift_jis. (i have also played around with these
(B> > and the get the same problems if this is changes to utf-8 or euc-jp)
(B> >
(B> > Generally, the html pages display Japanese without problem, however
(B> > there are a couple of particular kanji that do not display properly.
(B> > When entered into a html form they look fine, when the query the data is
(B> > used for is echoed back to the screen all is fine, but once they are
(B> > actually entered into the MySQL database they change.
(B> >
(B> > Examples of problem kanji...
(B> > yo-so-ku -> when this is stored in the database it changes to the kanji
(B> > for egg and a small katakana i...
(B> > yo-so-u  -> when this is stored in the database it changes to the kanji
(B> > for egg and a small z...
(B> > also
(B> > ko-u-chi-ku
(B> > ju-u-bu-n
(B> > hyo-u-to
(B> > hyo-u-sho-u
(B> >
(B> > Can this be changed by altering the encoding scheme chosen or are these
(B> > particular problem kanji and should just be avoided?
(B> >
(B> >
(B> > I would really appreciate your expertise in helping me make sense of
(B> > this.
(B> > Thanks,
(B> > Claire
(B> --
(B> -dave
(B>
(B> --
(B> PHP Internationalization Mailing List (http://www.php.net/)
(B> To unsubscribe, visit: http://www.php.net/unsub.php
(B
(B--
(B
(B------------------------------------------------
$B>>2
--- End Message ---
--- Begin Message ---
2004/04/07 ($B?e(B) 09:19 $B$K(B Claire Hector $B$5$s$O=q$-$^$7$?(B:
(B> I am aware that SJIS shouldn't be used for internal coding, however the config
(B> of the server is out of my control and the person who has set it up determined
(B> it was the best setup. It's his rice field ;-) .... i pointed out the very
(B> clear warnings from the php site and he showed me a japanese language site
(B> that basically justified this setup,
(B
(BIf that's the case then surely he must have the work-around to your SJIS
(Bmojibake problems as well, since they're more or less guaranteed to
(Bhappen with that set-up ;-) Incidentally I'd be interested in knowing
(Bthe URL he pointed to - sounds a bit fishy to me.
(B
(B>  so when he wouldn't budge I went and
(B> changed the config settings in both php and mysql myself to see if this would
(B> fix the problem thus I had:
(B> 
(B> Each page with shift_JIS encoding.
(B> 
(B> mbstring.language=Japanese
(B> mbstring.internal_encoding=EUC-JP
(B> mbsting.http_output=SJIS
(B> 
(B> MySQL table charater set ujis
(B
(BWith internal_encoding=EUC-JP your script is expecting all internal data
(B(including what comes from the DB) to be in EUC, so on output PHP is
(Bprobably trying to do a conversion from EUC to SJIS on text that is
(Bactually in ujis (whatever that is?). So you get complete mojibake. I
(Bthink you'll need the data coming from your DB in the same encoding as
(BPHP's internal encoding.
(B
(B> 
(B> and Apache using an additional module for Japanese from webDAV called
(B> mod_encoding
(B> with ServerEncoding set to utf-8 & DefaultClientEncoding as JA-AUTO-SJIS-MS
(B
(BDunno about webDav, but I'd guess that you'd want the ServerEncoding to
(Bbe the same as PHP's internal encoding and the DB data encoding, no?
(B
(BBasically what I've always done is have everything going to and from the
(Bclient in SJIS, and everything on the server in EUC. It's simple and
(BI've never had any problems with encoding. As far as I know this is more
(Bor less the standard way to deal with Japanese in PHP.
(B
(B
(B> ----------------------------------------------
(B-- 
(B-dave

--- End Message ---
--- Begin Message ---
I will get the url and post it as all the lit. I've seen in English says exactly
(Bwhat you have said.
(B
(BAs far as I know MySQL deals with Japanese using sjis & ujis character sets with
(Bujis being equivalent to euc-jp. [If anyone knows any different please feel free to
(Bcorrect this!] Having read, which you also confirm that the internal encoding of php
(Bshould be the same as whatever the database is I have tried setting both the server
(Bencoding (via webDav - i've never encountered this one before either) to euc-jp and
(Bphp's internal encoding to euc-jp with pages encoded as shift_jis and
(Bmbstring.http_output as shift_jis..... which gives me mojibake with all the japanese
(Btext on the pages and coming from the db.
(B
(BI think there must be something here that I am missing or there is something with
(Bthis webDav ...?!
(B
(BCheers,
(BClaire
(B
(BDavid Emery wrote:
(B
(B> 2004/04/07 ($B?e(B) 09:19 $B$K(B Claire Hector $B$5$s$O=q$-$^$7$?(B:
(B> > I am aware that SJIS shouldn't be used for internal coding, however the config
(B> > of the server is out of my control and the person who has set it up determined
(B> > it was the best setup. It's his rice field ;-) .... i pointed out the very
(B> > clear warnings from the php site and he showed me a japanese language site
(B> > that basically justified this setup,
(B>
(B> If that's the case then surely he must have the work-around to your SJIS
(B> mojibake problems as well, since they're more or less guaranteed to
(B> happen with that set-up ;-) Incidentally I'd be interested in knowing
(B> the URL he pointed to - sounds a bit fishy to me.
(B>
(B> >  so when he wouldn't budge I went and
(B> > changed the config settings in both php and mysql myself to see if this would
(B> > fix the problem thus I had:
(B> >
(B> > Each page with shift_JIS encoding.
(B> >
(B> > mbstring.language=Japanese
(B> > mbstring.internal_encoding=EUC-JP
(B> > mbsting.http_output=SJIS
(B> >
(B> > MySQL table charater set ujis
(B>
(B> With internal_encoding=EUC-JP your script is expecting all internal data
(B> (including what comes from the DB) to be in EUC, so on output PHP is
(B> probably trying to do a conversion from EUC to SJIS on text that is
(B> actually in ujis (whatever that is?). So you get complete mojibake. I
(B> think you'll need the data coming from your DB in the same encoding as
(B> PHP's internal encoding.
(B>
(B> >
(B> > and Apache using an additional module for Japanese from webDAV called
(B> > mod_encoding
(B> > with ServerEncoding set to utf-8 & DefaultClientEncoding as JA-AUTO-SJIS-MS
(B>
(B> Dunno about webDav, but I'd guess that you'd want the ServerEncoding to
(B> be the same as PHP's internal encoding and the DB data encoding, no?
(B>
(B> Basically what I've always done is have everything going to and from the
(B> client in SJIS, and everything on the server in EUC. It's simple and
(B> I've never had any problems with encoding. As far as I know this is more
(B> or less the standard way to deal with Japanese in PHP.
(B>
(B> > ----------------------------------------------
(B> --
(B> -dave

--- End Message ---
--- Begin Message ---
2004/04/07 ($B?e(B) 10:41 $B$K(B Claire Hector $B$5$s$O=q$-$^$7$?(B:
(B> I will get the url and post it as all the lit. I've seen in English says exactly
(B> what you have said.
(B> 
(B> As far as I know MySQL deals with Japanese using sjis & ujis character sets with
(B> ujis being equivalent to euc-jp. [If anyone knows any different please feel free to
(B> correct this!] Having read, which you also confirm that the internal encoding of php
(B> should be the same as whatever the database is I have tried setting both the server
(B> encoding (via webDav - i've never encountered this one before either) to euc-jp and
(B> php's internal encoding to euc-jp with 
(B
(B
(B> pages encoded as shift_jis
(B
(BBy "pages", do you mean templates, HTML inside PHP scripts or something
(Blike that that's run through PHP before being sent to the client? If so,
(Btry changing the encoding of these to EUC. 
(B
(B
(B-- 
(B-dave

--- End Message ---
--- Begin Message ---
I haven't got the url yet ... the network man seems to be hiding from me ;-)
(B
(BHowever I have managed to solve my mojibake problems using this Japanese url i stumbled
(Bacross ....
(Bhttp://homepage1.nifty.com/yito/anhttpd/faq/mysql.html [look under point 6 - nihongo
(Bhyouji]
(BIt seems the problem was with the MySQL installation.
(B
(BSo, funnily enough ... despite the obscure PHP config the particular problem kanji 
(Bseem to
(Bbe ok at this stage. !?!
(B
(BCheers,
(BClaire
(B
(BDavid Emery wrote:
(B
(B> 2004/04/07 ($B?e(B) 10:41 $B$K(B Claire Hector $B$5$s$O=q$-$^$7$?(B:
(B> > I will get the url and post it as all the lit. I've seen in English says exactly
(B> > what you have said.
(B> >
(B> > As far as I know MySQL deals with Japanese using sjis & ujis character sets with
(B> > ujis being equivalent to euc-jp. [If anyone knows any different please feel free to
(B> > correct this!] Having read, which you also confirm that the internal encoding of 
(B> > php
(B> > should be the same as whatever the database is I have tried setting both the server
(B> > encoding (via webDav - i've never encountered this one before either) to euc-jp and
(B> > php's internal encoding to euc-jp with
(B>
(B> > pages encoded as shift_jis
(B>
(B> By "pages", do you mean templates, HTML inside PHP scripts or something
(B> like that that's run through PHP before being sent to the client? If so,
(B> try changing the encoding of these to EUC.
(B>
(B> --
(B> -dave

--- End Message ---
--- Begin Message ---
FYI
(BHere is the Japanese url regarding php.ini settings & mbstring
(B
(Bhttp://tsuttayo.sytes.net/php/char_trn/
(B
(BClaire Hector wrote:
(B
(B> I haven't got the url yet ... the network man seems to be hiding from me ;-)
(B>
(B> However I have managed to solve my mojibake problems using this Japanese url i 
(B> stumbled
(B> across ....
(B> http://homepage1.nifty.com/yito/anhttpd/faq/mysql.html [look under point 6 - nihongo
(B> hyouji]
(B> It seems the problem was with the MySQL installation.
(B>
(B> So, funnily enough ... despite the obscure PHP config the particular problem kanji 
(B> seem to
(B> be ok at this stage. !?!
(B>
(B> Cheers,
(B> Claire
(B>
(B> David Emery wrote:
(B>
(B> > 2004/04/07 ($B?e(B) 10:41 $B$K(B Claire Hector $B$5$s$O=q$-$^$7$?(B:
(B> > > I will get the url and post it as all the lit. I've seen in English says exactly
(B> > > what you have said.
(B> > >
(B> > > As far as I know MySQL deals with Japanese using sjis & ujis character sets with
(B> > > ujis being equivalent to euc-jp. [If anyone knows any different please feel free 
(B> > > to
(B> > > correct this!] Having read, which you also confirm that the internal encoding of 
(B> > > php
(B> > > should be the same as whatever the database is I have tried setting both the 
(B> > > server
(B> > > encoding (via webDav - i've never encountered this one before either) to euc-jp 
(B> > > and
(B> > > php's internal encoding to euc-jp with
(B> >
(B> > > pages encoded as shift_jis
(B> >
(B> > By "pages", do you mean templates, HTML inside PHP scripts or something
(B> > like that that's run through PHP before being sent to the client? If so,
(B> > try changing the encoding of these to EUC.
(B> >
(B> > --
(B> > -dave
(B>
(B> --
(B> PHP Internationalization Mailing List (http://www.php.net/)
(B> To unsubscribe, visit: http://www.php.net/unsub.php
(B
(B--
(B
(B------------------------------------------------
$B>>2
--- End Message ---
--- Begin Message ---
Also, if you are using Apache, you can override php.ini settings using
.htaccess files, and those settings include all mbstring settings. This
means that you can set it to whatever internal/output encoding you like.
^_^ I am doing that right now at the server I am on, as my host is very
resilient regarding the matter.






> FYI
> Here is the Japanese url regarding php.ini settings & mbstring
>
> http://tsuttayo.sytes.net/php/char_trn/
>
> Claire Hector wrote:
>
>> I haven't got the url yet ... the network man seems to be hiding from me
>> ;-)
>>
>> However I have managed to solve my mojibake problems using this Japanese
>> url i stumbled
>> across ....
>> http://homepage1.nifty.com/yito/anhttpd/faq/mysql.html [look under point
>> 6 - nihongo
>> hyouji]
>> It seems the problem was with the MySQL installation.
>>
>> So, funnily enough ... despite the obscure PHP config the particular
>> problem kanji seem to
>> be ok at this stage. !?!
>>
>> Cheers,
>> Claire
>>
>> David Emery wrote:
>>
>> > 2004/04/07 ($B?e(B) 10:41 $B$K(B Claire Hector
>> $B$5$s$O=q$-$^$7$?(B:
>> > > I will get the url and post it as all the lit. I've seen in English
>> says exactly
>> > > what you have said.
>> > >
>> > > As far as I know MySQL deals with Japanese using sjis & ujis
>> character sets with
>> > > ujis being equivalent to euc-jp. [If anyone knows any different
>> please feel free to
>> > > correct this!] Having read, which you also confirm that the internal
>> encoding of php
>> > > should be the same as whatever the database is I have tried setting
>> both the server
>> > > encoding (via webDav - i've never encountered this one before
>> either) to euc-jp and
>> > > php's internal encoding to euc-jp with
>> >
>> > > pages encoded as shift_jis
>> >
>> > By "pages", do you mean templates, HTML inside PHP scripts or
>> something
>> > like that that's run through PHP before being sent to the client? If
>> so,
>> > try changing the encoding of these to EUC.
>> >
>> > --
>> > -dave
>>
>> --
>> PHP Internationalization Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
>
> ------------------------------------------------
> $B>>2<EE9)3t<02q<R(B
> $BIJ<AIt!!IJ<A4k2h?d?J%0%k!<%W(B
> $B%/%l%"!!%X%/%?!<(B
>
> Claire Hector
> Matsushita Electric Works Ltd.
> Quality Management System Group
> Corporate Quality Management
>
> E-mail: [EMAIL PROTECTED]
> Notes: [EMAIL PROTECTED]
>
> MIC:7-711-2470   [EMAIL PROTECTED](Bphone$B!K!'(B+81-6-6908-6803
> FAX:7-711-2479   [EMAIL PROTECTED](BFAX$B!K(B  $B!'(B+81-6-6906-2202
> ------------------------------------------------
>
> --
> PHP Internationalization Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Yes. Even MySQL 4.1 has poor support for UTF-8 (it doesn't support
4-byte character). Anyway you can still use DOS encoding for MySQL if
you use UTF-8.

> You shouldn't use SJIS for internal encoding or in your DB, or inside
> your PHP. It's evil and will cause exactly the type of problems you're
> having. I think the mbstring docs explain this. Setting
> mbstring.internal_encoding to EUC would be better. UTF is good too, but
> I don't think it's supported by MySQL. 

--- End Message ---
--- Begin Message ---
Have you tried "putenv", like:

putenv ('TZ=Europe/Amsterdam');


P.

"Andy Higgins" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I have a requirement to run two different sites that are in different time
> zones on the same machine. Does anyone know if this is possible to do by
> running two instances of php and making a change in the php.ini? Or do you
> have any other suggestions on how this can be done?
>
> Thank you.
>
> Regards,
> Andy

--- End Message ---

Reply via email to