aboutsummaryrefslogtreecommitdiff
path: root/test/cli.zig
diff options
context:
space:
mode:
authorErsikan <julien.philippon@epitech.eu>2021-03-14 18:07:09 +0100
committerErsikan <julien.philippon@epitech.eu>2021-03-17 10:27:26 +0100
commit8942243f7a825e42c16c8d210f5f9dc3baa76b2f (patch)
treeae67b24aeacd992e1a382e349d9b51d474bf3307 /test/cli.zig
parenta3540000909bdc6a59ba07c85d21afeb3a7e54e2 (diff)
downloadzig-8942243f7a825e42c16c8d210f5f9dc3baa76b2f.tar.gz
zig-8942243f7a825e42c16c8d210f5f9dc3baa76b2f.zip
zig fmt: factorize source file reading and decoding
Now reading a source file and decoding it from UTF-16LE to UTF-8 is done in a single function. Error messages are improved, and an error is emitted when the source file has a BOM not supported (UTF-16BE, UTF-32). Please note that the BOM of UTF-32 is composed of the same bytes as the BOM of UTF-16 followed by a null character. Therefore a source file in UTF-16LE starting with a null byte will be interpreted as an UTF-32, and rejeted because of an invalid format. In pratice this is not a problem, as the code would have been rejected later anyway because of the null character.
Diffstat (limited to 'test/cli.zig')
0 files changed, 0 insertions, 0 deletions