Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

TorgoX (1933)


"Il est beau comme la retractilité des serres des oiseaux rapaces [...] et surtout, comme la rencontre fortuite sur une table de dissection d'une machine à coudre et d'un parapluie !" -- Lautréamont

Journal of TorgoX (1933)

Thursday December 19, 2002
08:54 AM


[ #9544 ]
Dear Log,

I'm getting over the cold. It's eaten about two days of time that I could have spent on preparing for the move to Juneau. I.e., packing books and pots and pans and whatnot for the movers, packing up the computer stuff for Fedex, and sorting over which of my clothes I want to give to Goodwill (the most tempting solution is: everything I haven't worn in the past few days). The good news is that I really liked resting up, and now I have a week to get things together before the movers show up. Then Goodwill comes by for the furniture I'm not shipping up; then I take the cat to the vet, for his fit-for-travel certificate and, while we're at it, getting him microchipped; then I relax a few days in the near-empty house as I throw out the last things in the fridge, etc; then I give the car to Goodwill (it's in no condition to make it to Juneau, certainly not at this time of year); and then me and the cat hop on a plane. Then we spend January sleeping.

While I was bleary in bed with the cold, I did up a patch to improve Infobot handling of RDF factiods. It now has better error-reporting, and better handling of Unicode text. It now works like this: if eval "use utf8" works, then we know we have utf8 support, so we eval up a sub that looks like this:

  sub unutf8 {
    use utf8;
    my $out = $_[0];
    $out =~ s/[^\x00-\xFF]/~/g;
    return pack "C*", map ord($_), $out =~ m/(.)/g;
      # Should slap down from utf8 encoding into plain 8-bit,
      # without relying on any 5.8-isms or on any peculiarities
      # of the ever-shifting 5.6 interface.

(Otherwise we make a no-op sub of the same name.)

That pack ... m/(.)/g construct is my best attempt so far at portably turning UTF*-encoded strings (containing no chars over 255, once I nix them all) into just plain strings. Improvements welcome!

Anyway, once we get content back from XML::RSS, we feed it thru that unutf8 sub, to turn it into non-UTF8 text like most IRC clients would understand.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.