Re: Convert unicode escape sequences to unicode in a file
On Tuesday, January 11, 2011 3:36:26 PM UTC-7, Alex wrote:
> Are you _sure_ that your file contains the characters '\', 'u', '0',
> '0', 'e' and '9'? I expect that actually your file contains a byte
> with value 0xe9 and you have inspected the file using Python, which
> has printed the byte using a Unicode escape sequence. Open the file
> using a text editor or hex editor and look at the value at offset 947
> to be sure.
> If so, you need to replace 'unicode-escape' with the actual encoding
> of the file.
Yeah, I'm sure that's what the file contains. In fact, I solved my own problem while waiting for an answer. When writing to the file I need to *en*code instead of *de*code; i.e.,
o = open('newDice.sql', 'w')
|All times are GMT. The time now is 10:01 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.