authorgravatar for manlio.perillo@gmail.comManlio Perillo <manlio.perillo@gmail.com> 2023-01-16 19:14:43+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-01-17 20:07:53+02:00
log06e9b2c4e360e738c3be3d3e5d5a36006fd5b224
tree222eaf113636cc5d6455646949eacc35ce7bcd0f
parent7b68b76326a650fad4c20274601968d436920caf

langref: document UTF-8 BOM handling

The current compiler ignores the UTF-8 BOM if it is at the start of the file, and disallows it anywhere else. Document it in the Source Encoding section.

1 files changed, 4 insertions(+), 0 deletions(-)

doc/langref.html.in+4
......@@ -11480,6 +11480,10 @@ fn readU32Be() u32 {}
1148011480 but use of hard tabs is discouraged. See {#link|Grammar#}.
1148111481 </p>
1148211482 <p>
11483 For compatibility with other tools, the compiler ignores a UTF-8-encoded byte order mark (U+FEFF)
11484 if it is the first Unicode code point in the source text. A byte order mark is not allowed anywhere else in the source.
11485 </p>
11486 <p>
1148311487 Note that running <kbd>zig fmt</kbd> on a source file will implement all recommendations mentioned here.
1148411488 Note also that the stage1 compiler does <a href="https://github.com/ziglang/zig/wiki/FAQ#why-does-zig-force-me-to-use-spaces-instead-of-tabs">not yet support CR or HT</a> control characters.
1148511489 </p>