Mailing List Archive


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

Re: [tlug] OT-Japanese in PHP



Mark Sargent wrote:

> Thomas Savarimuthu wrote:
>
>> On Friday 20 May 2005 15:51, Mark Sargent wrote:
>>  
>>
>>> Hi All,
>>>
>>> I apologize up front if I've broken a golden rule, posting this here.
>>> I'm learning PHP/MYSQL and am trying to get Japanese pulled from the
>>> database to display correctly. I've set this at the top of my pages,
>>> <html lang="Shift_JIS">
>>> and this for the font
>>> <font type=\"Shift_JIS\">$product_data_output</font>
>>> I don't claim to know much about HTML either. I'm just building a
>>> little dynamic site for my company, minus any bells and whistles
>>> interface wise. I'm hoping some people on here work with this kind of
>>> thing daily. Again, if I'm outa line, sorry for that. Cheers.
>>>
>>> P.S. The Japanese displays fine in phpmyadmin on both Linux/Windows
>>> boxes.
>>>   
>>
>> PHP allows to have separate encodings for the internal php engine and 
>> for the html output. If you are running pho on any unix/linux 
>> platform, the preferred internal encoding is "EUC". For the output 
>> encoding, if you haven't set any output encoding convertion (using 
>> multibyte handler), the output might be an unconverted and hence will 
>> be in the encoding of the internal engine (EUC).
>>
>> Please check your php.ini file for the encoding settings in the 
>> [mbstring] section.
>>
>> -Thomas
>>
>>  
>>
> Hi All,
>
> thanx, Thomas. Yes, I'm running apache2.0.53 and php5.0.4 on Fedora3. 
> I'll check out what you mentioned. Cheers.
>
> Mark Sargent.
>
Hi All,

ok, I've taken a look at php.ini and found this,

[mbstring]
; language for internal character representation.
;mbstring.language = Japanese

; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
;mbstring.internal_encoding = EUC-JP

; http input encoding.
;mbstring.http_input = auto

; http output encoding. mb_output_handler must be
; registered as output buffer to function
;mbstring.http_output = SJIS

DoI change to,

mbstring.http_output = SJIS

and what of this here,

;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll

change to,

extension=php_mbstring.dll

This page,

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

says this,

mbstring is a non-default extension. This means it is not enabled by 
default. You must explicitly enable the module with the configure 
option. See the Install <http://www.php.net/manual/en/install.php> 
section for details.

I didn't install any extensions at install, so, am I looking at a 
recompile to get Japanese in php..? Sorry for what may seem like mundane 
Qs. Cheers.

Mark Sargent.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links