This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Christian.Clauss
Recipients Christian.Clauss, ezio.melotti
Date 2012-04-15.14:17:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334499448.33.0.168656695712.issue14587@psf.upfronthosting.co.za>
In-reply-to
Content
BUGS: certain diacritical marks can and should be capitalized...
    str.upper() does not .replace('à', 'À').replace('ä', 'Ä').replace('è', 'È').replace('é', 'É').replace('ö', 'Ö').replace('ü', 'Ü'), etc.
    str.lower() does not .replace('À', 'à').replace('Ä', 'ä').replace('È', 'è').replace('É', 'é').replace('Ö', 'ö').replace('Ü', 'ü'), etc.
    str.title() has the same problems plus it capitalizes the letter _after_ a diacritic. e.g. 'lüsai'.title() --> 'LÜSai' with a capitol 'S'
    myUpper(), myLower(), myTitle() exhibit the correct behavior with a handful of diacritic marks.

def myUpper(inString):
    return inString.upper().replace('à', 'À').replace('ä', 'Ä').replace('è', 'È').replace('é', 'É').replace('ö', 'Ö').replace('ü', 'Ü')

def myLower(inString):
    return inString.lower().replace('À', 'à').replace('Ä', 'ä').replace('È', 'è').replace('É', 'é').replace('Ö', 'ö').replace('Ü', 'ü')

def myTitle(inString): # WARNING: converts all whitespace to a single space
    returnValue = []
    for theWord in inString.split():
        returnValue.append(myUpper(theWord[:1]) + myLower(theWord[1:]))
    return ' '.join(returnValue)
History
Date User Action Args
2012-04-15 14:17:28Christian.Clausssetrecipients: + Christian.Clauss, ezio.melotti
2012-04-15 14:17:28Christian.Clausssetmessageid: <1334499448.33.0.168656695712.issue14587@psf.upfronthosting.co.za>
2012-04-15 14:17:27Christian.Clausslinkissue14587 messages
2012-04-15 14:17:27Christian.Clausscreate