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

Can not handle byte order mark at beginning of UTF-8 text files #4

Closed
knivil opened this issue Mar 23, 2020 · 1 comment
Closed

Can not handle byte order mark at beginning of UTF-8 text files #4

knivil opened this issue Mar 23, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@knivil
Copy link

knivil commented Mar 23, 2020

Assertion in debug mode on Visual Studio 2019 if ini files contains BOM like EF BB BF at the beginning (function ltrim). Works if BOM is removed manually.

Calling code:

std::ifstream file{ "hello.ini" };
tortellini::ini dict;
file >> dict;

https://en.wikipedia.org/wiki/Byte_order_mark

@Qix- Qix- added the bug Something isn't working label Mar 25, 2020
@Qix-
Copy link
Owner

Qix- commented Mar 25, 2020

Indeed. I've never used them myself, so if you'd like to contribute a fix then it'd be appreciated.

The non-wide BOM check here seems to be sufficient, if you'd like to PR:

https://stackoverflow.com/a/8882051

@Qix- Qix- closed this as completed in aeea095 Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants