[PATCH 0 of 1] replace Python standard textwrap by MBCS sensitive one for i18n text

Martin Geisler mg at lazybytes.net
Mon May 17 17:20:01 CDT 2010


FUJIWARA Katsunori <fujiwara at ascade.co.jp> writes:

> You are right. Line wrapping which is appropriate for almost all
> languages seems to be difficult and large as a patch for Mercurial, so
> this patch focuses only on MBCS safeness.

Good, we definitely don't want to cut multibyte characters into
pieces...

> In fact, I can not imagine how strictly people expects help document
> on tty to be wrapped, and do not know detail about line wrapping
> method for other east asian languages :-)

At least you know about one east asian language... that's one more than
me :-)

> So, this patch introduces "filltext"/"wraptext" hook points in i18n.py
> for easy overriding.

Should we not fix util.wrap instead? Or perhaps that function is too
specialized to wrap text with a hanging indentation?

> "Always treating them as full-width" seems to be good solution.
>
> For people who likes stricted line wrapping, overriding
> filltext/wraptext in mercurial/i18n module by custom one would be
> better than new environment variable.

Unless these ambiguous characters are very common, then I don't think
there is a big reason to worry about them. Treating them as full-width
is the conservative approach which will make some lines too short, but
that's better than them being too long.

-- 
Martin Geisler

Fast and powerful revision control: http://mercurial.selenic.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100518/8c894a67/attachment.pgp>


More information about the Mercurial-devel mailing list