That mysterious 01

Some time ago, we learned the story of that mysterious J. There is another mystery character that sometimes shows up in place of a smiley face: the \001.

The character starts out as the Unicode U+263A, which looks like this: ☺. In code page 437, this character lives at position 1, and depending on what program is being used to display the character, it might appear as a box (representing the character U+0001) or as the escape sequence \001.

You can think of this as a version of the mysterious J, but taking a route through code page 437, or you can think of it as how a bullet turns into a beep taken in reverse, then reversed again.

Comments (6)
  1. Joshua says:

    Part of the reason is the well-published conversion between Windows-1252 and Unicode maps 1 to 1. CP437 is not Windows-1252 but lots of people seem to think it is.

  2. Pedant says:

    @Joshua: you are thinking of ISO-8859-1, which is the only 8-bit character set that maps 1:1 to Unicode.  Windows-1252 is not ISO-8859-1 but lots of people seem to think it is.

  3. Joshua says:

    Hmmm Pedant misread 1 to 1 as equivalent mapping. I meant code point 1 to code point 1.

  4. Those dang homophones.

  5. Yuhong Bao says:

    "CP437 is not Windows-1252 but lots of people seem to think it is."

    Yep, the ANSI/OEM codepage confusion, common in console programs. Also note that besides this confusion, there is also the console input and output codepages, which typically defaults to but can be changes not to match the OEM codepage. BTW, the reason argv is ANSI not OEM is that GetCommandLineA returns it that way.

  6. DWalker says:

    I see "the mysterious J" in the three-line "auto-preview" of Outlook messages in my inbox.  When I read the message in the reading pane, or open the message and read it, I see the smiley face.  I quickly figured out what it is, and it wasn't important enough to complain to anyone about it.  I just figured out that for some reason, a smiley face shows up as a J in the auto-preview.

    Interesting that the smiley face gets position 1 in code page 437.  Whoever laid out that code page must have been happy about something that day!

Comments are closed.

Skip to main content