Re: Fix UTF Encoding issue
[email protected] ((Martin Koegler)) Tue, 4 Dec 2007 09:44:12 +0100
| Newsgroups | perl.unicode |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Dec 04, 2007 at 10:33:39AM +0200, Ismail Dönmez wrote:
> Following to_utf8 function works for me :
For me too (Debian sarge+etch).
> sub to_utf8 {
> ·  my $str = shift;
>
> Â Â if(utf8::valid($str))
> Â Â {
> Â Â Â Â utf8::decode($str);
> Â Â }
> ·
> Â Â return $str;
In the original thread, there was some discussion, that some people
might want a different fallback endcoding. So mayme you should
keep the second call to decode for the fallback encoding.
> }
mfg Martin Kögler