# zig fmt: fix non-UTF-8 encoding \#2820 · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/a3540000909bdc6a59ba07c85d21afeb3a7e54e2)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: a3540000909bdc6a59ba07c85d21afeb3a7e54e2

Requested commit: a3540000909bdc6a59ba07c85d21afeb3a7e54e2

Commit: a3540000909bdc6a59ba07c85d21afeb3a7e54e2

Tree: d671cf5efd931c7b89af4c6fb8612efae085d645

Author: Ersikan

Committer: Ersikan

## Message

```
zig fmt: fix non-UTF-8 encoding #2820

Fixes #2820

After reading the source code, the first two bytes are inspected, and
if they correspond to a UTF-16 BOM in little-endian order, the source
code is converted to UTF-8.

```

## Parents

- [f76bd56588e556ea580c1faa63667cc9264cc218](https://git.cafe/gitcafe/zig/commit/f76bd56588e556ea580c1faa63667cc9264cc218?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/a3540000909bdc6a59ba07c85d21afeb3a7e54e2?format=markdown)
