Stories
Slash Boxes
Comments
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)

TorgoX
  sburkeNO@SPAMcpan.org
http://search.cpan.org/~sburke/

"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)

Wednesday March 13, 2002
03:08 AM

"You dropped a BOM on me, baybay!"

[ #3479 ]
Dear Log,

When write-opening to a Unicode file, it is behoovy to then emit a byte-order mark before anything else:

print OUT "\x{feff}"; # Byte Order Mark

It even works happily with UTF8 files -- many applications correctly interpret as the resulting byte sequence as meaning "YES, THIS IS UTF8!".

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I don't see how that would work on UTF-8 files, since the UTF-8 BOM is 0xEF 0xBB 0xBF (very rarely used since it tends to muck things up somewhat). The ONLY thing 0xFE 0xFF can indicate is network byte order UTF-16.
  • It sounds like it should be a euphemism for a swearword.

    "You feffin' kids take your feffin' skateboards and your feffin' boomboxes somewhere else before I rip your feffin' heads open and take a feffin' coredump in the 0xdeadbeef inside!"

    --Nat