[Python-bugs-list] [ python-Bugs-411267 ] s.encode('latin-1') passes non-latin-1 c

noreply@sourceforge.net noreply@sourceforge.net
Mon, 26 Mar 2001 07:50:05 -0800


Bugs item #411267, was updated on 2001-03-25 19:31
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=411267&group_id=5470

Category: Unicode
Group: None
Status: Open
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: M.-A. Lemburg (lemburg)
Summary: s.encode('latin-1') passes non-latin-1 c

Initial Comment:
>>> u'\x81'.encode('latin-1')
'\201'

this should probably raise an exception.

  -- erno@iki.fi



----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2001-03-26 07:50

Message:
Logged In: NO 

every reference i can find on the web (and my linux
latin1(7) manual page) says they are 160-255...?

i think the reason for 128-159 characters not being used
might be that with the high bit stripped off they would be
ascii control characters and not printable.

  -- erno


----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2001-03-26 01:14

Message:
Logged In: YES 
user_id=38388

u'\x81' is a perfectly valid Latin-1 character, in fact, the
first
256 Unicode characters are the Latin-1 characters.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=411267&group_id=5470