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/2002-December/031030.html below:

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib textwrap.py,1.18,1.19

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib textwrap.py,1.18,1.19Greg Ward gward@python.net
Wed, 11 Dec 2002 09:39:57 -0500
[/F proves beyond a shadow of a doubt that string.whitespace is
 locale-sensitive]

Thanks, Fredrik!  That clarifies the behaviour Just is seeing.

Hey: I just realized that making textwrap trust string.whitespace is
wrong in at least one case: 0xa0 is *non-breaking* space in ISO-8859-1,
and converting it to 0x20 (regular ol' space) is clearly wrong -- the
"non-break" request will be ignored.  So Unicode or not, textwrap should
probably just hard-code the US-ASCII whitespace chars.

My attitude is that textwrap should work on European languages, whether
they are encoded in 8-bit "ASCII" or Unicode.  I suspect that passing an
arbitrary Unicode string to it is meaningles -- what the heck does it
even mean to wrap a string of Chinese or Hebrew or Devangari characters?
Beats me, and I think they're out of scope for textwrap.

So: do I even need to worry about the cornucopia of Unicode whitespace
characters at all?  Or can I sweep that can of worms under the rug?
(Pardon the horribly mixed metaphor.)

        Greg
-- 
Greg Ward <gward@python.net>                         http://www.gerg.ca/
Do radioactive cats have 18 half-lives?



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