Some languages, like V and Charcoal use their own character systems. In the meantime, next to all languages support common (one byte) UTF-8 characters with only a single byte as well.

Should be scored in UTF-8, or language charsets?

  • \$\begingroup\$ Not quite. I'm wondering which is preferred between language bytecount and standardized bytecount. \$\endgroup\$
    – JessLovely
    Apr 11, 2017 at 5:34

1 Answer 1


Code golf answers should be scored in whatever the interpreter can digest. If there's an X bytes file that does what it's supposed to do, you can claim a score of X bytes.

UTF-8 doesn't even apply to all languages. There are plenty of them (both older practical and newer recreational languages) that do not even understand UTF-8/Unicode, so encoding the source code in UTF-8 for scoring purposes is rather arbitrary. Other languages force you to use UTF-16. Again, UTF-8 doesn't make sense in this case.

Finally, there are languages that do not even have a concept of character (TI-Basic, byte code, etc.), and thus cannot be represented by any character encoding.

  • \$\begingroup\$ Should the BOM be counted if it's the only way an interpreter will accept a file of a given encoding? \$\endgroup\$
    – Pavel
    Apr 11, 2017 at 5:36
  • 1
    \$\begingroup\$ @ГригорийПерельман Yes. \$\endgroup\$
    – Dennis
    Apr 11, 2017 at 5:38
  • \$\begingroup\$ Might be worth posting this or something similar as an answer to the dupe target. "Answers are scored by the size of a file your language implementation understands, regardless of encoding" is our de facto standard, but it's not written down like that on the most relevant meta post, I think. \$\endgroup\$ Apr 11, 2017 at 8:33

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