Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File starting with a Byte Order Mark leads to UB #476

Open
Delian0 opened this issue Nov 9, 2024 · 3 comments · May be fixed by #493
Open

File starting with a Byte Order Mark leads to UB #476

Delian0 opened this issue Nov 9, 2024 · 3 comments · May be fixed by #493

Comments

@Delian0
Copy link

Delian0 commented Nov 9, 2024

Some character encodings, such as UTF-8, can start with a BOM. Rapid YAML currently does not give these any consideration.

@Delian0
Copy link
Author

Delian0 commented Jan 21, 2025

Could you elaborate on why it's better if the user does BOM skipping manually instead of it happening automatically during parsing?

@biojppm
Copy link
Owner

biojppm commented Jan 22, 2025

In fact dumping this on the user was not conforming to the standard. Working now on the implementation.

@Delian0
Copy link
Author

Delian0 commented Jan 22, 2025

Thanks. Coming from yaml-cpp, it did work automatically there before.

The standard says that double-quoted scalars can also contain BOMs. While I have encountered files containing a BOM before, I've never once seen double-quoted scalars having them, not even in JSON. So I think it's fine to leave such exceptional cases to the user.

biojppm added a commit that referenced this issue Jan 22, 2025
biojppm added a commit that referenced this issue Jan 23, 2025
biojppm added a commit that referenced this issue Jan 23, 2025
biojppm added a commit that referenced this issue Jan 23, 2025
biojppm added a commit that referenced this issue Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants