Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /trunk/installer/utf8_to.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8445 - (hide annotations) (download) (as text)
Tue Dec 17 12:15:31 2019 UTC (4 years, 3 months ago) by doda
File MIME type: text/x-perl
File size: 338 byte(s)
Merge branch 'unicode_buf'
1 doda 8445 use utf8;
2    
3     my $code = $ARGV[0];
4     my $in = $ARGV[1];
5     my $out = $ARGV[2];
6    
7     open(INP, "<:raw:utf8", $in) or die("error :$! $in");
8     open(OUT, ">:raw:encoding($code)", $out) or die("error :$! $out");
9    
10     my $line = 1;
11     while (<INP>) {
12     if ($line == 1 && $code !~ /utf/) {
13     # remove BOM
14     s/^\x{FEFF}//;
15     }
16     print OUT;
17     $line++;
18     }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26