More Mac::Glue Endianness Stuff: Unicode

| | Comments (0)
In theory, you should be able to send Unicode data via Apple events with a BOM. It's documented to be optional, but some apps seem to choke on it. So I send Unicode text without a BOM.

This is, obviously, a problem with Intel Macs.

So, here's the fix:

require Config;
my $bom = $Config::Config{byteorder} eq '1234' ? 'LE' : 'BE';
return new AEDesc typeUnicodeText, Encode::encode('UTF-16'.$bom, $_[0]);

New release coming soon. use.perl.org

Leave a comment

<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Entry

This page contains a single entry by pudge published on November 8, 2006 10:47 AM.

DYKR!!! was the previous entry in this site.

Election Night is the next entry in this site.

Find recent content on the main index or look in the archives to find all content.