[I18n-sig] Changing case

M.-A. Lemburg mal@lemburg.com
Tue, 11 Apr 2000 14:49:42 +0200


mark.mcmahon@eur.autodesk.com wrote:
> 
> Hi Marc,
> 
> I definately do not understand. \204 is lower_e_egu (spelling?) and \204 is
> lower_a_umlaut. Upper case of these should be \216 and \220 respectively.

Not in Latin-1... you are probably using a different code page
in your editor.

>>> u'ιδ'
u'\351\344'
>>> u'ιδ'.upper()
u'\311\304'
>>> print u'ιδ'.encode('latin-1')
ιδ
>>> print u'ιδ'.upper().encode('latin-1')
ΙΔ

Strange enough, I get these outputs on my Linux machine:

>>> print 'ιδ'.upper()
ιδ

Looks like the C lib doesn't know about upper case mappings
for these Latin-1 characters.
 
> (Probably will not display properly on all machines)
> --------------
> >>> s = u"ιδ"
> >>> s
> u'\202\204'
> >>> t = u"ΔΙ"
> >>> t
> u'\216\220'
> -------------
> Mark
> 
> <SNIP>
> Marc ->
> Those two characters don't have a lower/upper case mapping:
> 
> <SNIP>
> .lower() and .upper() only modify chars which do have such a
> mapping -- all others are left untouched.
> 
> --
> Marc-Andre Lemburg
> ______________________________________________________________________
> Business:                                      http://www.lemburg.com/
> Python Pages:                           http://www.lemburg.com/python/
> 
> _______________________________________________
> I18n-sig mailing list
> I18n-sig@python.org
> http://www.python.org/mailman/listinfo/i18n-sig

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/