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

Add BOM support #110

Open
drizt opened this issue Sep 13, 2018 · 0 comments
Open

Add BOM support #110

drizt opened this issue Sep 13, 2018 · 0 comments

Comments

@drizt
Copy link
Contributor

drizt commented Sep 13, 2018

Atm QJSON returns error for UTF with BOM encoded strings. QJsonDocument from Qt5 can handle with it. Qt5 has internal function

void Parser::eatBOM()

{
    // eat UTF-8 byte order mark
    uchar utf8bom[3] = { 0xef, 0xbb, 0xbf };
    if (end - json > 3 &&
        (uchar)json[0] == utf8bom[0] &&
        (uchar)json[1] == utf8bom[1] &&
        (uchar)json[2] == utf8bom[2])
        json += 3;
}

So JSON is good for Qt5 can be bad for QJSON.

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

No branches or pull requests

1 participant