Jython: Upper-ASCII characters '\351' from chr(233)

Maurice Bauhahn bauhahnm at clara.net
Fri Apr 20 15:32:23 EDT 2001


I'm trying to create a dictionary in jython where the key is an
individual character (one byte). Because of the difficulty of entering
each such character (especially the upper-ASCII ones or eventually
Unicode ones), it seems appropriate to have Jython convert a decimal or
hexadecimal number to a character. However whenever the chr() function
encounters a number above 127 the result is as follows:
>>> chr(127)
'?' (in fact a character like a house)
>>>chr(233)
'\351'
Any suggestions on how to get around this?

Hopefully,


--
Maurice Bauhahn

Home Email: bauhahnm at clara dot net






More information about the Python-list mailing list