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

Greg Ward gward@python.net
Thu, 12 Dec 2002 12:34:10 -0500


On 11 December 2002, Martin v. Löwis said:
> Please, don't assume any specific encoding. Why is Latin-1 better than
> KOI8-R? The only encoding that is truly better than all others is
> ASCII, since virtually all other encodings have ASCII as a subset
> (except for the EBCDIC ones, and, with limitations, the ISO-2022
> ones).

Sorry, I should have said *Western* European languages.

> [If you meant to suggest no specific processing for   disregard
> this comment]

Correct: 0xa0 (the ISO-8859-1 non-breaking space) is now just another
character, no matter what your locale says.

OK, here's a proposed policy statement for textwrap's I18N support (or
lack thereof):

  textwrap is intended for wrapping ASCII-encoded English-language text
  for use in fixed-width settings such as email messages and plain text
  files.  It also works for Unicode strings that only contain ASCII
  characters.  And it should work for other European languages that use
  Latin script and have similar line-breaking conventions for monospaced
  text as English.  textwrap is not intended for use with languages or
  character sets that do not use Latin characters.

I should add that to the docs.  (Should probably also mention that it
doesn't do hyphenation -- speaking of huge cans of worms!)

        Greg
-- 
Greg Ward <gward@python.net>                         http://www.gerg.ca/
This quote intentionally left blank.