Is the change in the word wrap rule possible?

Jean-Marc Desperrier jmdesp at alussinan.org
Fri Nov 9 17:56:43 UTC 2007


Marc Schumann wrote:
> 2007/11/6, Komiyama Yukie <ykomi5 at yahoo.co.jp>:
>> Users of my Bugzilla are using English and Japanese.
>> X : Character of Japanese
>> --- Present result ----
>> XXXXXXissue 
>> statusXXXXXXXXX[omission]XXXXXX
>> --- Wanted result ----
>> XXXXXXissue statusXXXXXXXXX[omission]XX
>> XXXX
>> In version 3.0(utf-8), is the change in the word wrap rule possible?
> [...]
>> Could you teach the method of changing the rule of word wrap?
>> I have not edited *.pm file.
>> And, I was not able to find the wrap() function* where being described.
> 
> you probably need to look at function wrap_comment in Bugzilla/Util.pm.

According to Yukie's description, it seems like this wrap_comment 
function has a serious i18n problem .

When I look in lxr, everything's done using Text::Wrap :
http://lxr.mozilla.org/bugzilla/source/Bugzilla/Util.pm#299

And when I look at Text::Wrap in CPAN, it looks like it might known 
nothing about i18n :
http://search.cpan.org/~muir/Text-Tabs+Wrap-2006.1117/lib/Text/Wrap.pm
"It is possible to control which characters terminate words by modifying 
$Text::Wrap::break. [...] The default is simply '\s'; that is, words are 
terminated by spaces."

I think the solution is to replace it with Unicode::Wrap :
http://search.cpan.org/~nesting/Unicode-Wrap-0.03/Wrap.pm
This module implements UAX#14: Line Breaking Properties.

Unfortunately, Unicode::Wrap doesn't seem to be a direct replacement, 
also it might have performance problems "This module can be slow. It's a 
pure-Perl implementation that goes through an expensive classification 
process per character."
And it won't do Thai correctly ;-)


_______________________________________________
dev-apps-bugzilla mailing list
dev-apps-bugzilla at lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-apps-bugzilla



More information about the developers mailing list