Python shell wont open idle or an exisiting py file

MRAB python at mrabarnett.plus.com
Sat Feb 1 03:54:55 CET 2014


On 2014-02-01 01:52, Chris Angelico wrote:
> On Sat, Feb 1, 2014 at 12:45 PM, Terry Reedy <tjreedy at udel.edu> wrote:
>> H:\HP_Documents\0PythonWork\AirplaneKinematics\accel2.py
>> caused this message
>> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 14:
>> invalid start byte
>
> So... something's interpreting \0 as codepoint U+0000 (which it
> shouldn't), storing that in "UTF-8" as 0xC0 0x80 (which it shouldn't),
> and then giving it to Python to decode. That's a weird little
> combination bug right there.
>
I think that some years ago I heard about a variation on UTF-8
(Microsoft?) where codepoint U+0000 is encoded as 0xC0 0x80 so that the
null byte can be used as the string terminator.

I had a look on Wikipedia found this:

http://en.wikipedia.org/wiki/Null-terminated_string




More information about the Python-list mailing list