Re: Fix UTF Encoding issue

2007-12-04 Thread Martin Koegler
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

Re: Fix UTF Encoding issue

2007-12-04 Thread Martin Koegler
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 th

Re: Fix UTF Encoding issue

2007-12-04 Thread Martin Koegler
On Tue, Dec 04, 2007 at 09:55:04AM +0200, Ismail Dönmez wrote: > Tuesday 04 December 2007 Tarihinde 09:50:28 yazmt??: > > The bug affects old versions of perl (Debian sarge = oldstable). > > As it works on the newer Debian etch, do you really think, that it is > > a good idea to report issue? >

Re: Fix UTF Encoding issue

2007-12-04 Thread Martin Koegler
On Tue, Dec 04, 2007 at 08:16:24AM +1030, Benjamin Close wrote: > Jakub Narebski wrote: > >On Mon, 3 Dec 2007, Martin Koegler wrote: > >>On Mon, Dec 03, 2007 at 04:06:48AM -0800, Jakub Narebski wrote: > >>>Ismail Dönmez <[EMAIL PROTECTED]> writes: > >>

Re: Fix UTF Encoding issue

2007-12-04 Thread Martin Koegler
On Mon, Dec 03, 2007 at 06:02:54PM +0100, Jakub Narebski wrote: > On Mon, 3 Dec 2007, Martin Koegler wrote: > > eval { $res = decode_utf8(...); } > > if ($@) > > return decode(...); > > return $res > > > > or > > > > eval { $res = decode_