1
\$\begingroup\$

U+007F, though it is not a C0 control character, Unicode still considers it as a control character. It is the deleted character.

If one mis-punched a character into a punched tape, one would turn it to the deleted character by punching all 7 holes. An interpreter for punched tapes would skip all deleted characters. ASCII followed this convention and thus assigned 0x7F the deleted character. And Unicode followed ASCII.

Following this convention, it would mean one must skip all U+007F. Does this mean U+007F doesn't contribute to a byte count at all?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Is there a modern interpreter that interprets 0x7F as ignore this character? \$\endgroup\$
    – Jo King Mod
    Commented Sep 1, 2020 at 6:09
  • \$\begingroup\$ @JoKing I don't know. \$\endgroup\$ Commented Sep 1, 2020 at 6:36
  • \$\begingroup\$ Then the premise one must skip all U+007F is false and therefore the answer to your last question is no. \$\endgroup\$
    – Jo King Mod
    Commented Sep 1, 2020 at 7:50

1 Answer 1

22
\$\begingroup\$

It counts as one byte in ASCII, UTF-8, and any language-specific SBCS

Regardless of how the character was treated in the history, 0x7F is a perfectly valid byte value to appear in a source code file. And when we score bytes, we are essentially counting the number of bytes in the source code file. Therefore, the character 0x7F should be counted as one byte like any other byte value.

Otherwise every single code-golf challenge would have Lenguage, 0 bytes.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I think the only time this wouldn't apply is if there was some language where the deleted character was used for its actual purpose, and ignored. But then you'd just remove it before posting. \$\endgroup\$
    – rydwolf
    Commented Sep 4, 2020 at 14:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .