Read file that starts with '\xff\xfe'

Bob Gailer bgailer at alum.rpi.edu
Mon Sep 8 08:43:05 EDT 2003


At 06:13 AM 9/8/2003, Gerhard Häring wrote:

>Bob Gailer wrote:
>>On Win 2K the Task Scheduler writes a log file that appears to be 
>>encoded. The first line is:
>>'\xff\xfe"\x00T\x00a\x00s\x00k\x00 
>>\x00S\x00c\x00h\x00e\x00d\x00u\x00l\x00e\x00r\x00 
>>\x00S\x00e\x00r\x00v\x00i\x00c\x00e\x00"\x00\r\x00\n'
>
>I wrote that into a file, and used the 'file' utility from Cygwin, which 
>tells me:
>
>$ file t
>t: Little-endian UTF-16 Unicode character data, with CR line terminators

That's a good start. I presume I need to use codecs.open(filename, mode[, 
encoding[, errors[, buffering]]]) to read the file. What is the actual 
value of the "encoding[" parameter for "Little-endian UTF-16 Unicode 
character data, with CR line terminators"

Bob Gailer
bgailer at alum.rpi.edu
303 442 2625

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20030908/913d1ab6/attachment.html>
-------------- next part --------------

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.506 / Virus Database: 303 - Release Date: 8/1/2003


More information about the Python-list mailing list