in reply to Re^2: UTF-8 text files with Byte Order Mark
in thread UTF-8 text files with Byte Order Mark
my $octets = encode("utf8", $line); $octets =~ s/^\x{ef}\x{bb}\x{bf}//; $line = decode("utf8", $octets);
is the same thing as
my $BOM = decode("utf8", "\x{ef}\x{bb}\x{bf}"); $line =~ s/^$BOM//;
is the same thing as
my $BOM = chr(0xFEFF); $line =~ s/^$BOM//;
is the same thing as
$line =~ s/^\x{FEFF}//;
which is what I gave you. Much simpler!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: UTF-8 text files with Byte Order Mark
by muba (Priest) on Feb 13, 2007 at 21:01 UTC | |
|
Re^4: UTF-8 text files with Byte Order Mark
by Anonymous Monk on Sep 30, 2011 at 18:30 UTC | |
by ikegami (Patriarch) on Oct 01, 2011 at 21:53 UTC | |
|