Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: UTF-8 text files with Byte Order Mark

by ikegami (Pope)
on Feb 13, 2007 at 20:48 UTC ( #599778=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
            my $octets = encode("utf8", $line);
            $octets =~ s/^\x{ef}\x{bb}\x{bf}//;
            $line = decode("utf8", $octets);
    
  2. or download this
            my $BOM = decode("utf8", "\x{ef}\x{bb}\x{bf}");
            $line =~ s/^$BOM//;
    
  3. or download this
            my $BOM = chr(0xFEFF);
            $line =~ s/^$BOM//;
    
  4. or download this
            $line =~ s/^\x{FEFF}//;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://599778]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2015-07-02 01:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (25 votes), past polls