Re: Problem with Shift_JIS script encoding

David Emery <[email protected]>
Newsgroups gmane.comp.php.internationalization
Message-ID <1090572034.1357.166.camel@hat>
2004/07/23 (金) 16:21 に PHPDiscuss - PHP Newsgroups and mailing lists
さんは書きました:
> I've been having a lot of trouble since upgrading over PHP4.3.1. Here's
> the problem:
> 1. My scripts are all written in Shift_JIS
> 2. When I try to send mail using the mb_send_mail function, the messages
> written in 
> my scripts in Shift_JIS are not properly encoded (it appears that PHP
> thinks that the 
> code is in EUC and is making an incorrect conversion).

I guess PHP thinks the code is in EUC because you're telling it in the
config that it's in EUC with the following line.

;; Set internal encoding to EUC-JP
> mbstring.internal_encoding = EUC-JP  

In the long run, I think you'd be better off to do your scripts in EUC,
but if you want them in SJIS then you should set the internal encoding
to SJIS. IIRC, there's also a config setting for
mbstring.script_encoding which you'd also want to set to SJIS.

There's more info on this in the docs. 

Hope that helps,
-dave


>   
> 
> 
> 
> 
> >From searching around online, it would appear that it is possible to
> convert the 
> Shift_JIS code into EUC code by the following settings:
> 
> ;; Enable Output Buffering
> output_buffering     = On
> 
> ;; Set mb_output_handler to enable output conversion
> output_handler       = mb_output_handler
> 
> ;; Set HTTP header charset
> default_charset      = Shift_JIS
> 
> ;; Set default language to Japanese
> mbstring.language = Japanese
> 
> ;; Set http input encoding conversion to auto
> mbstring.http_input  = auto 
> 

> ;; Do not print invalid characters
> mbstring.substitute_character = none
> 
> 
> However, it does not work. Any suggestions would be GREATLY appreciated....

-- 
PHP Internationalization Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.