Re: [PHP] About Guest Book\'s messages....

2003-05-29 Thread Lew Mark-Andrews
>I used wordwrap($word,40,"\n",1) to prevent it,
>but my system is BIG5 ,two bytes,
>Sometimes this method would  destroy the structure
>of the two-bytes word.

Hi,

Have you looked into the multi-byte string functions in the manual?
Search on php.net for mb_str .
Also, have you tried just forcing the guestbook display (tables?) to a
fixed width with HTML or CSS.
If you're still stuck, you might ask about this on the PHP
Internationalization [PHP-I18N] Mailing List which focuses on multi-byte
issues.

HTH,
Lew



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Japanese character validation

2003-11-07 Thread Lew Mark-Andrews
Howdy,

>> I have accept input from the user and check if the input is
>> japanese character only,
>> for example : If name is accepted , I need to check if its
>> any of the Hiragana, Katakana or Kanji.
>
>Hmm... why would you like to do that? I've never really seen
>the need for that.

It's actually quite common for forms here in Japan (both online and paper)
where the user is requested to give the phonetic reading in Hiragana or
Katakana for their Kanji name. (Especially the first name where there can
be a lot of latitude on the reading even if the Kanji used has other more
conventional readings. Likewise for some uncommon place names.) Online, it
can also be handy where you want to disallow the use of and catch and
filter numbers or symbols that may also have double-byte equivalents, and
instead use only the Hankaku ASCII forms, though these can usually be
validated more directly by an A - Z, 0 - 9, etc. regular expression.

We currently do this to validate our form inputs on the client side using
Javascript functions before accepting the inputs serverside. When I have
time, I'll look into what's possible with the mb_ereg/mb_regex functions.
Umesh, if you'd like a copy of our Javascript functions, please contact me
offlist.

Hope this helps,
Lew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php