iman_saleh has asked for the wisdom of the Perl Monks concerning the following question:
Hello all,
I wrote the following piece of code to convert a UTF-8 text into windows-1256 encoding. I don't know why the encoding of the output file is Unicode big endian. Please if anyone can help me with that tell me where is the problem.
#----------------------------------------------- use Unicode::UTF8simple; $uref = new Unicode::UTF8simple; open(IN, $ARGV[0]) or die; open(OUT, ">$ARGV[1]") or die; while(<IN>) { $string = $uref->fromUTF8("windows-1256",$_); print OUT $string; } close(IN); close(OUT); #-----------------------------------------------
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Conversion from UTF-8 to windows-1256 encoding
by Sixtease (Friar) on Oct 29, 2007 at 10:09 UTC | |
by iman_saleh (Novice) on Oct 29, 2007 at 11:25 UTC | |
by almut (Canon) on Oct 29, 2007 at 12:21 UTC | |
by ikegami (Patriarch) on Oct 29, 2007 at 17:48 UTC | |
by Sixtease (Friar) on Oct 29, 2007 at 11:50 UTC | |
by iman_saleh (Novice) on Oct 29, 2007 at 12:19 UTC |
Back to
Seekers of Perl Wisdom