Comments (4)
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.
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.
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.
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)
- Add tests for "Permit more control characters in comments"
- Contradicting tests `invalid/no-seconds.toml` and `valid/no-seconds.toml` HOT 6
- Millisecond truncation is incorrect HOT 1
- Millisecond decoder tests pass with second precision output HOT 1
- Transfer to the toml-lang organisation? HOT 7
- Split `invalid/float/trailing-us-exp.toml` into two tests HOT 5
- valid/table/array-one fails when using inline array and table HOT 2
- Consider adding some performance tests HOT 1
- [Valid Tests] Add Extra Spaces in Inline Tables HOT 1
- Clarify if - is permitted as a starting character in bare keys (toml 1.0.0) HOT 1
- Add tests for newlines within an array nested in an inline table
- Inconsistent test result of '+inf' HOT 4
- Add a test for oversized floating-point literals HOT 4
- `valid/integer/long` test does not seem relevant for specification compliance HOT 5
- Encoder tests expect submillisecond precision HOT 3
- Required int/float sizes implementations need to support? HOT 1
- Invalid JSON in example code HOT 2
- Should leap seconds be validated? HOT 2
- Debian 10 install fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toml-test.