Front page | perl.perl5.porters |
Postings from July 2004
Re: Stray strange chars in perltoc
Thread Previous
|
Thread Next
From:
Tels
Date:
July 2, 2004 05:36
Subject:
Re: Stray strange chars in perltoc
Message ID:
200407021413.48928@bloodgate.com
-----BEGIN PGP SIGNED MESSAGE-----
On Monday 28 June 2004 11:43, Nick Ing-Simmons wrote:
> Tels <perl_dummy@bloodgate.com> writes:
> >Moin,
> >
> >I have a brandnew SuSE 9.1 which includes a Perl 5.8.3, perl -V output
> >below.
> >
> >After switching to the new system I got problems with German Umlaute in
> > my sig (it is the output of a small perlscript into my mail-editor).
> > While investigating this, I notced that perldoc perltoc produces some
> > strange characters that look like little rectangles:
>
> SuSE 9.1 puts you in a UTF-8 locale by default.
> Perl doesn't however encode to UTF-8 by default, so your ü is just
> a single high-bit char, which doesn't decodes as valid UTF-8
> so you get a rectangle for a "bad character".
> (I have Konsole font set to Unicode so I get a question mark on a black
> background.)
Ok, there are two issues here:
* that the output form Perl is not seen as valid text (utf8?) by my mailer
* the stray rectangles in the doc instead of minus (-)
We ignore the first issue. I have set my konsole font to Unicode and the
stray rectangles are now dashes or dots. So far, so good. However, having
experimented with Encode and Copy&Pasted some code (to solve issue #1,
which we don't talk about here), I noticed that I get error messages like:
Unknown encoding 'iso‐8859‐1' at sig.pl line 24
Further Copy&Paste from the Encode manpage resulted finally in:
Unrecognized character \xE2 at sig.pl line 23.
Sooo, what happens is that the author of the doc has a Unicode font and put
in the "wrong" dashes - e.g. \xe2. When I turn off the Unicode, I see lotsa
rectangles - when I turn it on I see dashes, but these are not the valid
ones (minus) you would need for Perl, e.g.
te@linux:~> perl -le 'printf ("%x\n", ord("-"))'
2d
I guess the docs should be fixed by replacing \xe2 with \x2d. While it might
not matter for purely ornamental stuff, it *does* matter for program code
and example snippets. Note that you won't see the differences with Unicode
font! [0]
Can we automate this task somehow? I guess the Encode manpage is not the
only one that suffers from this, as seen in perldoc perltoc :)
Best wishes,
Tels
[0] Unicode fonts seems to be actually a bad idea as it hides differences -
and I still don't know why it was considered a good idea to have the
ability to write Perl source code in Unicode - oh well....just ranting..
- --
Signed on Fri Jul 2 14:10:29 2004 with key 0x93B84C15.
Visit my photo gallery at http://bloodgate.com/photos/
PGP key on http://bloodgate.com/tels.asc or per email.
"We have problems like this all of the time," Kirk said, trying to
reassure me. "Sometimes its really hard to get things burning." --
http://tinyurl.com/qmg5
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
iQEVAwUBQOVRencLPEOTuEwVAQGsfAf+Mi02QE6hCyHIXsIFJdO/zudzTmNIVGVu
W5APJy0Z6+PtZNSQtk/SsCHD0Bcm7PRK+hU1vL0izGgbYyL1LfOWmqfUVTOVYXzz
uUhg5aFSEcBigu+90T0dFjn+8Wzwqi25fqDESlloILHKrIAsdBF83wzDb1knME35
BWUg0yg6vzqUKcbXhnMMxTx4t+0Sqj6W0OqGUmuzKnqBGhdkpT98KNr8nYGgXezs
uhqClG53vpzHank7Ofhn9svptLWxVqA4Cilhb2mhFKuGkFssgQIJQQkQfyZUkTLh
6RC/d+UbYgrVPW4wPoBIYRUM6jGQGuYEiPYi8e6iQvIdrgeO22Tsug==
=GIGN
-----END PGP SIGNATURE-----
Thread Previous
|
Thread Next