
rovf
Veteran
Apr 23, 2010, 2:44 AM
Post #7 of 8
(1202 views)
|
|
Re: [britanb] Convert txt file to ASCII
[In reply to]
|
Can't Post
|
|
Well, first of all, if there seems to be a problem with the format, Notepad would pretty much the last utility I would use to check what's in a file. Better to use a text editor which also permits hexadecimal display (such as jEdit or PsPad - the latter is only available on Windows). From Perl, you can read any file in Binary, which means that the real task you need to face is finding out *how* the file needs to be transformed; i.e. the principal problem is that of knowing the encoding of the original file, which is not a Perl problem. Once this has been established, we can look further what you need to do to translate. For instance, if you find out that the original file is UTF-8 incoded, you just would need to use the :utf8 layer to read the file. If it is, however, a "unusual" encoding, you would have to program it by yourself.
|