Note added for reference: This is a spec change. The current implementations reject source code ...
12 years, 7 months ago
(2012-09-06 16:48:23 UTC)
#2
Note added for reference:
This is a spec change. The current implementations reject source code containing
the (aptly named) BOM. However, that behavior violates the Unicode spec, which
requires us to accept, harmlessly, a BOM at the beginning of a file, thank you
Notepad.
We could permit (and ignore) an initial BOM only and that would satisfy Unicode.
However, the issue will probably come up again if two BOM-marked files are
concatenated with a Unicode-unaware tool, or if some nonconformant program
writes it out. The RFC for syslog encourages putting a BOM on every message,
which is not only wrong it's crazy, but that tells us there are people out there
who think BOMs provide seasoning to the data and we'll probably see a Go source
file with extra flavor one day.
Therefore, in the hope that we will never have to bother with these aBOMinations
again, we have decided to ignore them wherever they appear, with the curious but
important exception of string and rune literals, where they could conceivably be
placed on purpose.
Issue 6506083: code review 6506083: spec: ignore BOMS outside of string and rune literals.
(Closed)
Created 12 years, 7 months ago by r
Modified 12 years, 7 months ago
Reviewers: dsymonds
Base URL:
Comments: 0