1
\$\begingroup\$

There are tasks explicitly defined with Unicode. For example, Supreme Sum String

To correctly work with a unicode data, a script should be saved as UTF-16 or UTF-8 with BOM. Even if the script itself does not contain Unicode characters. At least for Powershell it is.

How to calculate the length (a golf score) of a script that should work correctly with Unicode?

  • case 1: The script does not contain Unicode characters and have saved in UTF-16
  • case 2: The script does not contain Unicode characters and have saved in UTF-8 with BOM
  • case 3: The script contains Unicode characters and have saved in UTF-8 with BOM
\$\endgroup\$
5
\$\begingroup\$

We score by bytes, not characters.

Measuring bytes is independent of the encoding used. You may get fewer characters out of your bytes if you use UTF-32, but the choice of encoding is up to the submission author and the language.

As to the encoding of characters in the input/output, that is for the OP to decide.

\$\endgroup\$
  • \$\begingroup\$ I'm agree - We score by bytes. What about BOM marker for UTF-8 with BOM? \$\endgroup\$ – mazzy Oct 6 '18 at 13:18
  • 3
    \$\begingroup\$ If the language requires it to parse the script, then it is counted. The BOM marker is no different than any other byte(s). \$\endgroup\$ – Nathan Merrill Oct 6 '18 at 13:40
  • \$\begingroup\$ @mazzy Depends on whether the script contains the BOM marker - that's up to the author. \$\endgroup\$ – user202729 Oct 7 '18 at 2:05
1
\$\begingroup\$

Count Bytes Of Function Submission Without BOM

You may choose any codepages your interpreter understand. And bytes are counted instead of characters. BOM should belong to the whole program instead of certain functions. So, you have to include the bytes count of BOM for a full program submission if you need it in your source code, but omit it if you are submitting a function.

\$\endgroup\$

You must log in to answer this question.

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