On Fri, May 27, 2005 at 10:45:42AM +0200, Francois Gouget wrote:
Martin Quinson wrote:
[...]
>>* Text::WrapI18N (perl module)
Ok. I can understand why it would be important to use it for writing po
files and Sgml files. It's a shame it's used everywhere but there ;-)
(I've seen your other email explaining why it's that way).
exactly.
What I don't understand is why it is used to print informational
and
error messages. Won't the xterm wrap things on its own? It does just
fine when I print a very long line in French or English. Doesn't it do
the same CKJ languages? If not I'd say it is pretty broken.
It may be seen as cosmetics. We wanted the error location to be more
obvious, something like:
toto.sgml:43: you stupid user, you did it again and gave me a file where the
<p> tag is not closed, even if I told you not later than 5
minutes ago that you shouldn't.
toto.sgml:46: Oh well. This file is really crappy: you don't even close the
<a> tag. This *is* an error you ought to fix.
It's not a plain wrapping, but respects the indentation we wanted to make it
look better (in our opinions). For sure, when the dependency is not there,
you could use print() without wrapping, it wouldn't breaking anything
(beside my/our sense of beauty wrt error messages ;).
My next question has to do with the wrapper implementation. I did not
check it out in details but it seems like it works on the multibyte
string. Wouldn't it be possible to implement a wrapper using the Perl
5.8 Unicode support?
Maybe. But this version is not really widespread yet, is it? If you come up
with a working implementation of that (I'm really bad at such issues and
leave Denis or Jordi answer), you could test whether we are using perl >=
5.8 and if not, fallback to libtext-wrap18n-perl, couldn't you?
You could also not wrap anything when the dependency isn't there. As temp
solution, it would perfectly work, I guess.
Mt.