Re: Chinese (BIG5/GB) characters
| From: | Hironori Neal Sato | Date: | Wed, 23 Aug 2000 02:20:23 +0000 |
| Subject: | Re: Chinese (BIG5/GB) characters | ||
| References: | 1 | Groups: | php.i18n |
| Request: | Send a blank email to php-i18n+get-59@lists.php.net to get a copy of this message | ||
Hi
Following answer is based on using PHP with Japanese. Since both
Japanese and Chinese are multi-byte encoded, my guess shouldn't be
far off.
On Wed, Aug 23, 2000 at 11:13:55AM +1000, Jason Murray wrote:
>As a Newbie(tm) here, please go easy if I've gotten a few things wrong.
What have you gotten wrong?
>I need to create a website in English that will accept BIG5 and/or GB
>input in an form <INPUT> tag, and be able echo/print this in HTML in
>subsequent pages.
Are you saving that data by any chance (database, file, etc)?
>I'm a little lost as to what support PHP has for this kind of thing. Of
>course, the English content and the actual HTML construction of the page
>isn't a problem... its just getting the variable into PHP, manipulating
>and outputting it again that *is* a problem in my mind, since it's not
>ASCII ... if anyone can help, it'd be *much* appreciated (hey, you'll
>even make it into the credits page - if there ends up being one, not my
>decision :))
If you just receive input data and echo/print on the next page, it
shouldn't be a problem.
Problem with manipulation of data will depend on what you do with that
text data. If you do any regex, most likely it will fail since PHP's
regex is not designed to work with multibyte encoding such as big5 or
gb. If you are simply doing something like:
<?php print $text1 . "/" . $text2; ?>
It should work. But something like:
<?php print ereg_replace("^[[:alpha:]]", "", $text2); ?>
It may work, or it may not. Since both gb and big5 can contain 7bit
range byte for the second byte of a charactor, regex like above will
not work the way you expect.
Does this answer your question?
Hiro
--
Hironori Neal Sato <satoh@yyplanet.com>
YYplanet.com - http://www.yyplanet.com/