Giter Club home page Giter Club logo

Comments (4)

arp242 avatar arp242 commented on August 19, 2024

Are you sure that's invalid? I think that's just how JSON works because it's always in UTF-16 or something, but I'd have to read the spec to be sure.

e.g. \U0010ffff in TOML is 0xdb 0xff 0xdf 0xff in UTF-16 BE, and that fits with the \udbff\udfff in the JSON.

Which language/JSON parser are you using for this? Most languages seem to work fine with these escapes, but I'm always open to changing something if it improves compatibility.

from toml-test.

arp242 avatar arp242 commented on August 19, 2024

I guess it's this one: cyanskies/another-toml-cpp#11

Maybe I'm missing something, but I don't see a way to run the tests?

from toml-test.

cyanskies avatar cyanskies commented on August 19, 2024

I run the tests using this repo https://github.com/cyanskies/another-toml-test
It builds encoder and decoder executables that I test using the precompiled toml-test executable.

I'm using an in-tree copy of SimpleJSON.
I was assuming that JSON was in utf8 and passing the string across directly, so it might be my mistake then.

from toml-test.

arp242 avatar arp242 commented on August 19, 2024

From https://datatracker.ietf.org/doc/html/rfc8259 :

To escape an extended character that is not in the Basic Multilingual Plane, the character is represented as a 12-character sequence, encoding the UTF-16 surrogate pair. So, for example, a string containing only the G clef character (U+1D11E) may be represented as "\uD834\uDD1E".

So seems the behaviour is correct.

That SimpleJSON hasn't been updated since 2016. Maybe it's bugged? Your project doesn't compile for me.

toml++ uses https://github.com/nlohmann/json: https://github.com/marzer/tomlplusplus/tree/master/vendor

toml11 has some thing they wrote themselves: https://github.com/ToruNiina/toml11/blob/master/tests/check_toml_test.cpp

from toml-test.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.