Perl Bug?

Volume 7, Issue 80; 11 May 2004; last modified 08 Oct 2010

Something has changed in Perl 5.8.4 that breaks my conduits, maybe yours. (Updated: a little debugging after all.)

I upgraded today (apt-get rocks) and got Perl 5.8.4. Something has gone horribly wrong in my Palm XML Conduits. It’s got something to do with Unicode and ISO-8859-1 characters and Data::Dumper and maybe some of my own code.

The publicly available conduits are much older than the ones I’m running (I’m way overdue for a new release), but I suggest you tread carefully.

I’m not likely to have time to investigate in the immediate future. For the moment, I’ll probably hack some ASCII encoding of the characters together.

Ugh.

Yes, I’m sure I should report the bug somewhere, but I just can’t scrape together the time.

Ugh.

Update 12 May 2004

I’m on the road again this week, so I scraped together a couple of extra hours and did a little debugging. It appears to be have been related to my use of XML::DOM::encodeText(…) and XML::DOM::XmlUtf8Encode(…). After a little shotgun debugging and reading about Perl Unicode support, I replaced the former with unpack("U0U*", …) and the latter with pack("U", …).

That’s made the problem go away, which is sort of like solving the problem. Sort of. Anyway, that’s where I’m going to stop.

(btw, the upgrade in question was from Perl 5.8.3 to Perl 5.8.4, nothing as dramatic as going from 5.6 or something.)

Comments

If you've come from Perl 5.6.*, try adding something like "binmode(STDOUT,':utf8');" in there somewhere. Pick the correct output file handle of course. Depending upon your input, you may want to use the Encode module to convert to UTF-8 from whatever input encoding you have.

Perl 5.8 unicode is generally pretty reasonable, and has a lot more control than Perl 5.6.

Failing all that, if you can demonstrate a bug in a short piece of code, please submit it with perlbug! I'm sure that there are some people on perl5-porters who would love to hear from you.

-Dom

—Posted by Dominic Mitchell on 12 May 2004 @ 06:47 UTC #