[PerlChina] about unicode

Formalin Achilles formalin14 at gmail.com
Mon Dec 12 22:11:51 PST 2005


最好用syswrite而不是print

那一步出错?


2005/12/13, 黄叶 <hylinux at gmail.com>:
>
> in addition, how use the function named "binmode "?
> Can i get a complete code?
> here is i write , but it is not work.
>
> #!/usr/bin/perl -w
> use strict;
> use IO::File;
> use Encode qw(encode decode from_to);
>
> my $file = IO::File->new("./report.csv", "r") or die " $!";
> my $file_temp = IO::File->new("./li.txt", "w") or die "$!";
>
> my $i = 1;
> my $a = "\"2005-8\"";
> if ( $a =~ /^"/ ) {
> print "OK", "\n", $a, "\n";;
> }
>
> while ( $b = <$file> ) {
>         from_to($b, "UTF-16LE", "Latin1");
> #       my $b = decode("UTF-16LE", $_);
>         print $b, "\n";
>         print $file_temp $b, "\n";
> $i++;
> }
>
> $file->close();
> print $i, "\n";
>
>
>
> >
> >
>
> _______________________________________________
> China-pm mailing list
> China-pm at pm.org
> http://mail.pm.org/mailman/listinfo/china-pm
>



--
---------------------------
Achilles Xu
http://www.formalin14.org
-------------- next part --------------
q?????!???,r??m??m???????j+??j)r?j??j?r????9?w?o?!???


More information about the China-pm mailing list