Re: trimming spaces from multibyte strings
| From: | Moriyoshi Koizumi | Date: | Wed, 07 May 2003 17:03:31 +0000 |
| Subject: | Re: trimming spaces from multibyte strings | ||
| References: | 1 | Groups: | php.i18n |
| Request: | Send a blank email to php-i18n+get-555@lists.php.net to get a copy of this message | ||
Jean-Christian Imbeault <jc@mega-bucks.co.jp> wrote:
> 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?
Right, the default behaviour of trim() is *known* to be multibyte safe.
> >>But 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? :)
>
> 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 ...
What SSH client do you usually use? I use TeraTerm Pro with an SSH
extension.
TeraTerm Pro: http://hp.vector.co.jp/authors/VA002416/teraterm.html
TTSSH: http://www.zip.com.au/~roca/ttssh.html
> 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 :(
Yes, there could well be the wonderful mb_trim() and your contribution
will be greatly appreciated, but I don't realise the number of people who
demand that yet, and some equivalent made of userland functions will
suffice. Your request still seems to me in a narrow niche :)
Moriyoshi