A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-December/041473.html below:

[Python-Dev] str.ascii_lower

[Python-Dev] str.ascii_lower [Python-Dev] str.ascii_lowerMartin v. Loewis martin at v.loewis.de
Mon Dec 29 13:04:56 EST 2003
Jeff Epler wrote:

>>>>u"I".lower()  # Python bug? (should be u'\u0131')
> 
> u'i'

As Guido says: unicode.tolower is locale-inaware;
it uses the Unicode Consortium character properties
instead to determine the lower-case character.

>>>>"I".lower()   # C library bug? (should be "\xc4\xb1")*
> 
> 'I'

This is really a limitation of the C language, not of
the C library. The interface is

char tolower(char input);

so it can only accept and return a single char. Multi-byte
characters are not supported in that interface.

Traditionally, for characters that cannot be converted,
tolower returns its argument.

>>>>"I".lower()   # (UTF-8 locale works properly in english)
> 
> 'i'

This is because "i" is a single byte in UTF-8.

Regards,
Martin


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4