Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: help needed in unicode files

by idsfa (Vicar)
on Mar 28, 2006 at 15:57 UTC ( #539731=note: print w/replies, xml ) Need Help??

in reply to help needed in unicode files

Yes. File::BOM will do this for you. Not that you should be writing a BOM for UTF-8 (kind of difficult to get confused about the byte order on one byte wide characters), but I expect you are dealing with (broken) MicroSoft apps.

Updated: You should really read the documentation. There are several examples in it of how to do what you appear to be asking for. Here's one:

# Read open(HANDLE, '<:via(File::BOM)', $filename) # Write open(HANDLE, '>:encoding(UTF-8):via(File::BOM)', $filename)

The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon

Replies are listed 'Best First'.
Re^2: help needed in unicode files
by ambrus (Abbot) on Mar 28, 2006 at 16:59 UTC

    While there's only one byte order for utf8 (unlike utf16), the BOM might still make sense to easily distinguish utf8 from other encodings.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://539731]
[TCLion]: Good Morning Monks, I am parsing logs and some date time formats are inconsistent. I am trying to make output all same format. What is the best way to convert a month(word) to month(number)?

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2017-03-23 14:35 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (287 votes). Check out past polls.