eval { $sCodepoints = decode( "iso-8859-1", $sLine, Encode::FB_CROAK ) }; if ( $@ ) { # input was not iso-8859-1 print "> No ISO-8859-1, maybe UTF8 ?\n"; $sCodepoints = $sLine; }