Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #100577
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Should stdlib files contain 'narrow non breaking space' U+202F? |
| Date | 2015-12-18 11:16 +1100 |
| Message-ID | <mailman.42.1450397817.30845.python-list@python.org> (permalink) |
| References | <n4vf3d$rer$1@ger.gmane.org> <CAPTjJmoa5dBiDJ5zDu4jEy4MjOm6vp=J3zLqJw7ZfEUf9da=DQ@mail.gmail.com> <n4vifh$ksb$1@ger.gmane.org> |
On Fri, Dec 18, 2015 at 11:02 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote: > A lot of it is down to Windows, as the actual complaint is:- > > six.print_(source) > File "C:\Python35\lib\encodings\cp1252.py", line 19, in encode > return codecs.charmap_encode(input,self.errors,encoding_table)[0] > UnicodeEncodeError: 'charmap' codec can't encode character '\u202f' in > position 407: character maps to <undefined> > > And as usual I've answered my own question. The cp1252 shows even if my > console is set to 65001, *BUT* I'm piping the output to file as it's so much > faster. Having taken five minutes to run the code without the pipe > everything runs to completion. > > I suppose the original question still holds, but I for one certainly won't > be losing any sleep over it. Talking of which, good night all :) Oh. Windows. Suddenly it all makes sense. Python source code is (as of 3.0) Unicode text, and is assumed to be stored as UTF-8 if not otherwise specified. If Windows can't handle that, too bad for Windows. ChrisA
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Should stdlib files contain 'narrow non breaking space' U+202F? Chris Angelico <rosuav@gmail.com> - 2015-12-18 11:16 +1100
csiph-web