Auros (auros) wrote,

  • Mood:

I want perl to act stupider, demmit.

Apparently the sysadmin must've upgraded our version of perl over the weekend, or early this morning, or something. A bunch of scripts I have for handling data in various encodings (mostly ISO-8859-*, but also a few WinCP things, and one Unicode format), and converting between those encodings, which all used to work just fine, now give weird error messages about invalid UTF-8 characters. And UTF-8 isn't even one of the encodings I'm working with. (I stick to fixed-width UTF-16-LE, both because fixed-widths are convenient, and because it's the Windows native Unicode format, which makes it convenient for viewing on the evil WinXP and Win2k boxen.)

I've tried various "binmode" incantations -- you'd think that applying it to every filehandle in sight ought to be sufficient -- but nothing seems to be working. It even insists that /^\xFF\xFE/ is not a valid regexp, because \xFF\xFE isn't valid UTF-8. Well, no shit, perl; maybe that's because I'm not working in UTF-8, eh? It's a perfectly valid match for the beginning of a UTF-16-LE file.

And I can't find the sysadmin to ask him to roll back the change. And I really need to get some stuff done within the next day or so, and can't do it without either using my existing tools, or rewriting them to deal with whatever change has happened inside perl.


It should not be trying to tell me what encoding I'm working in. It should just treat the file as a byte stream, and leave encoding stuff up to me. Stupid clever language designer, thinking he's cleverer than me. :-P

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded