Re: trimming spaces from multibyte strings
| From: | Jean-Christian Imbeault | Date: | Wed, 07 May 2003 02:40:04 +0000 |
| Subject: | Re: trimming spaces from multibyte strings | ||
| References: | 1 2 3 4 | Groups: | php.i18n |
| Request: | Send a blank email to php-i18n+get-554@lists.php.net to get a copy of this message | ||
Moriyoshi Koizumi wrote:
Since trim() can take the second parameter as well so you can specify which character to be trimmed,True. But if I understand correctly then the "default" trim() (without supplying a list of characters) *is* multibyte safe, though it might not remove all whitespace?
In many case, the full-width space isn't treated as a generic white space in regex expressions.I've found that out :) According to the regexp specifications (if there are any) *should* the full-width space be treated as generic whitespace?
Yes. Horribly so :) In my case it is difficult because for one, our PHP server do not have japanese input or editing capabilities so I cannot type any Japanese into a regexp for example, secondly I often access PHP servers across SSH from a non-japanese machine so even if the server could handle japanese input I don't have an IME ... But my main gripe is that someone came up with the wonderful trim() function. Could someone come up with the wonderful mb_trim() function? :) I would code it myself and contribute but I am not very proficient in the issues concerning multibyte character sets :( JcBut since you suggest it I will ask for this as a new feature as I really do find it difficult to remove whitespace from multibyte strings :)Well, do you really find it difficult? :)