Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #97053 > unrolled thread

Re: Readlines returns non ASCII character

Started byMRAB <python@mrabarnett.plus.com>
First post2015-09-24 01:09 +0100
Last post2015-09-24 01:09 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Readlines returns non ASCII character MRAB <python@mrabarnett.plus.com> - 2015-09-24 01:09 +0100

#97053 — Re: Readlines returns non ASCII character

FromMRAB <python@mrabarnett.plus.com>
Date2015-09-24 01:09 +0100
SubjectRe: Readlines returns non ASCII character
Message-ID<mailman.111.1443053408.28679.python-list@python.org>
On 2015-09-24 00:51, paul.hermeneutic@gmail.com wrote:
>   If this starts at the beginning of the file, then it indicates that
> the file is UTF-16 (LE).
>
> UTF-8[t 1]     EF BB BF       239 187 191
> UTF-16 (BE)    FE FF          254 255
> UTF-16 (LE)    FF FE          255 254
> UTF-32 (BE)    00 00 FE FF    0 0 254 255
> UTF-32 (LE)    FF FE 00 00    255 254 0 0
>
The "signature" EF BB BF indicates the encoding called "utf-8-sig" by
Python. It occurs on Windows.

If the file doesn't start with any of these, then it could be using any
encoding (except UTF-16 or UTF-32).

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web