BOM BOM BOM

| | Comments (0)
In Mac::Glue, I have some code to automatically convert text to UTF-16 if typeUnicodeText (utxt) is expected. It uses Encode, and it seems to work fine for stuff like setting the iChat status message.

But when a user tried to send Unicode text to Adobe Photoshop CS, it failed. Hm.

After some experimentation, I found that if I sent the text without the BOM, using UTF-16BE to encode (big-endian is assumed without it ... though I am not sure if it will work that way should Mac OS ever run on a little-endian platform), it worked.

I found a technote describing how some apps couldn't handle the BOM when it was placed on the clipboard. I guess some apps have trouble with it in Apple events too, which is why I found that utxt data created by AppleScript and the like doesn't have the BOM either. 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 February 12, 2004 5:09 PM.

Dean was the previous entry in this site.

Mixed Messages is the next entry in this site.

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