perl-unicode

Re: Fix UTF Encoding issue

2007-12-04 06:21:27
On Tue, Dec 04, 2007 at 10:12:50AM +0200, Ismail Dönmez wrote:
I think just a better method is to use (not tested):

if( is_utf8($str) ) 
{
      return decode_utf8($str);
}
else {
      return decode($str);
}

I already tried this function. It does not test, if a string is
really UTF-8. It seems to be to intended to check, if perl stores
the string internally in a multi byte encoding.

mfg Martin Kögler.

<Prev in Thread] Current Thread [Next in Thread>