php-i18n Digest 6 Mar 2003 14:21:09 -0000 Issue 157

Topics (messages 487 through 489):

Re: Is it multi-byte safe?
        487 by: Moriyoshi Koizumi
        488 by: Jean-Christian Imbeault

Configuring Multibyte.
        489 by: ricoche

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 ---
Just correcting a typo :)

Moriyoshi Koizumi <[EMAIL PROTECTED]> wrote:

> <?php
> mb_internal_encoding("Shift_JIS");
> $escaped = mb_ereg_replace("([\\\"'\0])", "\\\\1", $sjis_string);
> ?>

should be 

<?php
mb_internal_encoding("Shift_JIS");
$escaped = mb_ereg_replace("([\\\\\"'\0])", "\\\\1", $sjis_string);
?>

Moriyoshi


--- End Message ---
--- Begin Message --- Moriyoshi Koizumi wrote:

You can avoid this issue by configuring a PHP build with --enable-zend-multibyte option and set mbstring.script_encoding to SJIS.

Or better yet, make sure that all pages are in EUC-JP and use that for internal encoding too, right :)


And also translate all user input to internal encoding by setting encoding_translation = On.

Doing those two things should let me use the regular PHP addslashes().

Jc


--- End Message ---
--- Begin Message ---
Hello there,

After searching endlessly on the Internet and reading the manuals I'm still
a bit lost as to how to solve this problem I'm having.

I recently acquired a new dedicated server and have installed PHP 4.3.1 with
multi-byte enabled.  I'm trying to translate a forum called vbulletin into
EUC-JP.  I'd like to do Shift_JIS but I don't think it will work when users
type in their messages.  The Japanese seems to come out garbled.  I saw a
vbulletin forum at http://sb.xrea.com/ that uses EUC-JP very well and I'd
love to know how they did it.

Anyway,  I'm not sure how to configure my php.ini file to correctly set up
my server for EUC-JP.  Here is what I've done thus far.  Is this correct?

--enable-mbstring
--enable-mbstr-enc-trans
--enable-mbregex

output_buffering      = Off
default_charset       = EUC-JP
mbstring.language = Japanese
mbstring.encoding_translation = On
mbstring.http_input   = auto
mbstring.http_output  = EUC-JP
mbstring.internal_encoding = EUC-JP
mbstring.substitute_character = none

For Apache I did the following in httpd.conf:

LanguagePriority  jp   en
AddCharset EUC-JP          .euc
AddCharset ISO-2022-JP     .jis
AddCharset SHIFT_JIS       .sjis
AddLanguage  jp   .jp

For my HTML headers I added the following Meta tags:

<meta http-equiv="content-type" content="text/html;charset=x-euc-jp">
<meta http-equiv="content-type" content="text/html;charset=euc-jp">

Is there anything else I need to do to ready my server for EUC-JP?  Do I
need to add anything to my PHP script files or to Mysql?

Basically I live in Japan and wish to provide an opportunity for people to
write in Japanese and English on my vbulletin forum similar to the site
stated above.  I'd really love to get this going so I'm hoping someone out
there could offer some help with this if possible, or point me in the right
direction.

Thanks,

Jim

--- End Message ---

Reply via email to