llvm / llvm/llvm-project

[clang] Detection of BOM in `#embed`-ed file

Open
#201,471 4 comments 1 reaction 0 assignees View on GitHub
c23 clang:frontend confirmed embed
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

I attempted to embed a binary file that coincidentally happened to begin with the bytes `00 00 FE FF`

Specifically the first few bytes were as follows:
```
00000000: 0000 feff feff 0000 0000 0700 0000 0600 ................
```

The following error was produced:
```
fatal error: UTF-32 (BE) byte order mark detected in '...',
but encoding is not supported
```

I do not expect `#embed`-ed files to be checked for a BOM.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.