On the Soapbox

Welcome to McDonaldΓÇÖs; would you like some mangling with your encoding?

Saturday, May 7, 2011
Keywords: Technology

As a programmer, I see the world a bit differently, which is why the error on this McDonald's receipt caught my attention:

This, of course, is what happens when U+2019 (the right single quotation mark) is encoded in UTF-8 and then decoded using the IBM "OEM" code page (CP437). My guess is that the machine used to print the receipt is too simple (and/or old) to recognize UTF-8. However, if you look at the receipt's date, it does print apostrophes correctly, with the desired directionality. Which brings us to their second mistake: the right single quotation mark is semantically incorrect*: for possessives, the correct punctuation is an apostrophe (U+0027). Since the apostrophe falls within the 7-bit ASCII range, it is encoded identically in UTF-8 and CP437 (and many other encodings) and is generally immune to encoding mangling. This is why the apostrophe prints correctly, but not the right single quotation mark.

So first, McDonald's used a semantically incorrect* punctuation mark (quotation instead of apostrophe) and then they sent that character, encoded in UTF-8, to a machine that apparently only understands CP437. You would think that one of the biggest companies in the world would be more technically competent than this.

I suspect, however, that another major company may share in part of this blame: Microsoft. Specifically, their word processor auto-"corrects" apostrophes into single quotes. While this "correction" is semantically correct if the apostrophes were being used as quotes, it is not* when the apostrophes are actually used as, well, apostrophes. It is plausible that someone could have used Word to draft possible greeting texts for use on receipts and then copied-and-pasted them into the receipt system.

________________
* Yes, I know that the Unicode Consortium sanctions the use of U+2019 as an apostrophe. No, I do not agree with their position on that.

This entry was edited on 2011/05/07 at 02:06:11 GMT -0500.