php-i18n Digest 5 Dec 2003 05:51:05 -0000 Issue 207
Topics (messages 645 through 648):
Re: Japanese katakana "SO" in SJIS gives problems.
645 by: Jean-Christian IMbeault
646 by: Jean-Christian IMbeault
647 by: David Emery
mbstring configuration for php.ini file
648 by: Ligaya Turmelle
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 ---
David Emery wrote:
> 2003年11月19日(水)の19時27分に
> Jean-Christian IMbeault 曰く:
>
>>I'm having trouble with POST form data being passed to me in Japanese.
>>The incoming data is in SJIS and if someone enters the japanese katakana
>>"SO" it somehow ends up being turned up in to "SO\".
>
> There are other characters in SJIS that cause similar problems too.
> Setting EUC as the internal encoding should fix it.
Ok, can you explain why setting the internal encoding to EUC fix this
problem? It doesn't seem like it should.
Also when I ran this test my internal encoding was EUC ...
Thanks,
Jean-Christian Imbeault
--- End Message ---
--- Begin Message ---
Moriyoshi Koizumi wrote:
> Turning off magic_quotes_gpc in your php.ini will fix that problem.
magic quotes is off in my php.ini.
> to multibyte string. Please refer to the archive for detailed
> information about SJIS weirdness, as I already posted something to
> the thread of a relevant topic.
I'm looking for it now :)
Jc
--- End Message ---
--- Begin Message ---
2003年12月02日(火)の16時36分に
Jean-Christian IMbeault 曰く:
> David Emery wrote:
> > 2003年11月19日(水)の19時27分に
> > Jean-Christian IMbeault 曰く:
> >
> >>I'm having trouble with POST form data being passed to me in Japanese.
> >>The incoming data is in SJIS and if someone enters the japanese katakana
> >>"SO" it somehow ends up being turned up in to "SO\".
> >
> > There are other characters in SJIS that cause similar problems too.
> > Setting EUC as the internal encoding should fix it.
>
> Ok, can you explain why setting the internal encoding to EUC fix this
> problem? It doesn't seem like it should.
>
> Also when I ran this test my internal encoding was EUC ...
Hmmm, that's kinda weird. The idea is that with the internal encoding
set to EUC (i.e. mbstring.http_input = auto; mbstring.http_output =
SJIS;, mbstring.internal_encoding = EUC-JP;), PHP will automatically
convert the incoming post/get data to EUC for you, and convert your
output back to SJIS for browsers like keitai, etc that prefer that, and
so you never have to deal with the evil SJIS inside your scripts.
Could it be that the conversion somehow isn't happening?
>
> Thanks,
>
> Jean-Christian Imbeault
--
-dave
--- End Message ---
--- Begin Message ---
I am trying to change the configuration of my php.ini file in my test server
to allow for Japanese and Korean characters. I have NEVER worked with this
kind of file so I am very unsure what to do. By using the example from the
php.net page on mbstring I have made some changes. I however am not sure if
I did the right things. Right now I beleive that it is only set up to handle
Japanese. Please can someone look over my work to make sure I haven't
screwed up too bad. I am the only programmer in house so I have no one who
has experience working with Japanese and Korean characters to ask for help.
Oh and did I mention that this is my first project for an Asian market? So
please be gentle. I am going to write the pages in UTF-8 and allow the user
to input English, Japanese, or Korean.
Thanks,
Ligaya Turmelle
php.ini file:
[mbstring]
; language for internal character representation.
mbstring.language = Neutral ; Set default language to neutral(UTF-8)
(default)
mbstring.language = English
mbstring.language = Japanese
;mbstring.language = Korean ;For Korean market later
; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
mbstring.internal_encoding = UTF-8
; http input encoding.
mbstring.http_input = pass
mbstring.http_input = auto
mbstring.http_input = UTF-8
mbstring.http_input = UTF-8, SJIS, EUC-JP
; http output encoding. mb_output_handler must be
; registered as output buffer to function
mbstring.http_output = pass
mbstring.http_output = UTF-8
; enable automatic encoding translation accoding to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
; portable libs/applications.
mbstring.encoding_translation = On
; automatic encoding detection order.
; auto means
mbstring.detect_order = auto
mbstring.detect_order = ASCII, UTF-8, SJIS, EUC-JP, JIS
; substitute_character used when character cannot be converted
; one from another
;mbstring.substitute_character = none;
; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
;mbstring.func_overload = 0
--- End Message ---