Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] OT-Japanese in PHP



On 5/20/05, David E <dave@?om> wrote:
> From: Mark Sargent <powderkeg@example.com> on Date: Fri, 20 May 2005 16:45:18 +0900
> ;; For Japanese handling ;;
> default_charset = Shift_JIS;
> mbstring.http_input = auto;
> mbstring.http_output = SJIS;
> mbstring.internal_encoding = EUC-JP;
> mbstring.encoding_translation = On;
> mbstring.script_encoding = EUC-JP;
> mbstring.language = Japanese;
> mbstring.substitute_character = none;
> mbstring.detect_order = auto;

To change these settings, I think that it is better do do it from
inside your script, and not in php.ini. There are php functions to do
this :). Here is the corresponding documentation from php.net :

http://www.php.net/manual/en/ref.mbstring.php

Usually, at the beginning of my php scripts I use the following commands:
----
$enc = "sjis";
$lang = "ja";
mb_http_output($enc);
ob_start("mb_output_handler");
mb_internal_encoding("utf-8");
ini_set("mbstring.language", $lang);
----

I prefer to have utf-8 as internal encoding, because then we can not
only handle japanese characters but also other languages (better for
multilingual scripts ;)).

My 2 yens

Evan


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links