Mailing List Archive


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

Re: [tlug] OT-Japanese in PHP



Erin D. Hughes via info@example.com wrote:

> David E wrote:
>
>> From: Mark Sargent <powderkeg@example.com> on Date: Wed, 25 May 
>> 2005 17:31:49 +0900
>>
>>
>>> Erin D. Hughes via info@example.com wrote:
>>>
>>>
>>>> Mark Sargent wrote:
>>>>
>>>>
>>>>> Hi All,
>>>>> output_handler = mb_output_handler
>>>>> mbstring.language = Japanese
>>>>> mbstring.internal_encoding = UTF-8
>>>>> mbstring.http_input = auto
>>>>> mbstring.http_output = SJIS
>>>>> mbstring.encoding_translation = On
>>>>> mbstring.detect_order = auto
>>>>> mbstring.substitute_character = none
>>>>> mbstring.internal_encoding = EUC-JP
>>>>>
>>>>> Now, I think I still haven't got the page that requires J, 
>>>>> displayed right, yet. Full code is below. Can anyone see any 
>>>>> mistakes..? Cheers.
>>>>
>>
>>
>> You haven't given any details on what seems wrong with the output.
>> This is kind of obvious, but have you made sure the text in the
>> database is in the sme encoding as you have mbstring.internal_encoding
>> set to? (You have it set twice, to different values in your config
>> above - I assume the last one set gets used, but safer to just make up
>> your mind, don't you think?)
>>
>> Dave
>>
> Dave I agree that is another valid point.
>
> I think he should first rule out the other problems though
>
> A. Make a test page with some Japanese text in HTML and test. IS that 
> OK? If yes go to B
>
> B. Make a test page in PHP with the same text and test. IS that OK? If 
> yes go to C.
>
> C. Make a test PHP page that pulls data from the DB. And in 3 separate 
> lines with each line (data in the db encoded differently IE UTF-8, 
> Shift-jis and EUC) and see what comes out right.
>
> Also it is important to check the co-location in your DB if your using 
> MYSQL 4.XXXXXXXXXX there are very specific settings that I have had a 
> lot of trouble with my self in the past..... But that is another issue 
> I am sure.
>
> E./
>
>
Test A:
Hondaは、スポーティで安心感のある走りに加え、上質な内外装、高い安全性能 
により好評を得ているアコードシリーズ(アコード/アコードワゴン)を改良 
し、本日より全国のホンダクリオ店から発売する。

 アコードでは、充実した装備の24TLにエアロパーツや17インチアルミホイー 
ル、スポーツサスペンションを装備した「スポーツパッケージ」を、アコードワ 
ゴンでは、2.0Lエンジンを搭載したベーシックなタイプ「20A」を、それぞれ新 
たに設定。お客様の幅広い要望に応えられるタイプ設定とした。
 また今回、アコード20A、20ELのFF車と、アコードワゴン20A、24EのFF車は 
「平成17年排出ガス基準75%低減レベル(★★★★低排出ガス車)」認定を新たに取 
得し、高い環境性能を実現するとともにグリーン税制の適用対象を拡大した。


Result Test A(Comes out as coded in UTF-8)
Honda縺ッ縲√せ繝昴・繝・ぅ縺ァ螳牙ソ・─縺ョ縺ゅk襍ー繧翫↓蜉 縺医∽ク願ウェ縺ェ 
蜀・、冶」・・ォ倥>螳牙・諤ァ閭ス縺ォ繧医j螂ス隧輔r蠕励※縺・k繧「繧ウ繝シ繝峨 
す繝ェ繝シ繧コ・医い繧ウ繝シ繝会シ上い繧ウ繝シ繝峨Ρ繧エ繝ウ・峨r謾ケ濶ッ縺励∵悽譌・ 
繧医j蜈ィ蝗ス縺ョ繝帙Φ繝繧ッ繝ェ繧ェ蠎励°繧臥匱螢イ縺吶k縲・縲繧「繧ウ繝シ繝峨〒 
縺ッ縲∝・螳溘@縺溯」・y縺ョ24TL縺ォ繧ィ繧「繝ュ繝代・繝・d17繧、繝ウ繝√い繝ォ繝 
溘・繧、繝シ繝ォ縲√せ繝昴・繝・し繧ケ繝壹Φ繧キ繝ァ繝ウ繧定」・y縺励◆縲後せ繝 
昴・繝・ヱ繝・こ繝シ繧ク縲阪r縲√い繧ウ繝シ繝峨Ρ繧エ繝ウ縺ァ縺ッ縲・.0L繧ィ繝ウ繧ク 
繝ウ繧呈政霈峨@縺溘・繝シ繧キ繝・け縺ェ繧ソ繧、繝励・0A縲阪r縲√◎繧後◇繧梧眠 
縺溘↓險ュ螳壹ゅ♀螳「讒倥・蟷・コ・>隕∵悍縺ォ蠢懊∴繧峨l繧九ち繧、繝苓ィュ螳壹→ 
縺励◆縲・縲縺セ縺滉サ雁屓縲√い繧ウ繝シ繝・0A縲・0EL縺ョFF霆翫→縲√い繧ウ繝シ繝峨 
Ρ繧エ繝ウ20A縲・4E縺ョFF霆翫・縲悟ケウ謌・7蟷エ謗貞・繧ャ繧ケ蝓コ貅・5・・ス取ク帙Ξ 
繝吶Ν・遺・笘・・笘・ス取賜蜃コ繧ャ繧ケ霆奇シ峨崎ェ榊ョ壹r譁ー縺溘↓蜿門セ励@ 
縲・ォ倥>迺ー蠅・ァ閭ス繧貞ョ溽樟縺吶k縺ィ縺ィ繧ゅ↓繧ー繝ェ繝シ繝ウ遞主宛縺ョ驕ゥ 
逕ィ蟇セ雎。繧呈僑螟ァ縺励◆縲・

Now, I realized, after an email from Dave E that I had 
internal.encoding as UTF-8 although the database encoding is SJIS. I 
just wasn't fully understanding what all the settings were doing. I've 
now changed the internal to SJIS, double checked that the page is set 
for SJIS also, but, the page only displays if I either change it in the 
browser to UTF-8 or set the page to that(Test A page, that is). I've 
added below my settings. The original page, that displays the database 
content, which is set to Shift_JIS also still doesn't display, at all. 
Thoughts..? Cheers.

EDIT: I went and copied the data from the database into the Test A page 
and it also would only display correctly if I set it to UTF-8 in the 
browser. So, this narrows it down to, that the code is being coded to 
UTF-8. I don't understand this, as I've set all settings to SJIS. 
Obviously I'm missing something very fundamental, which I'm sure will 
pointed out to me, real quick. Cheers, again.

Mark Sargent.


mbstring.detect_order auto

mbstring.encoding_translation On

mbstring.func_overload 0

mbstring.http_input Auto

mbstring.http_output SJIS

mbstring.internal_encoding SJIS

mbstring.language Japanese

mbstring.substitute_character no value


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links