Comments (6)
Ah I found something interesting.
It seems like the error is random.
From my gist example, I have tested by only taking the first item and removing the rest.
So I only have this left:
{
"version": 1,
"items": [
{
"id": "en_cat",
"name": "cat",
"lang": "en",
"defs": [
{
"id": "en_cat_1",
"def": "A cat is a domestic animal of the feline family.",
"trans": {
"fr": ["fr_chat_1"],
"ru": ["ru_ко́шка_1"]
},
"ex": [
"My cat is lazy and never hunts mice.",
"Tigers are just very big cats."
]
}
]
}
]
}
It still doesn't work.
But if I change this:
"trans": {
"fr": ["fr_chat_1"],
"ru": ["ru_ко́шка_1"]
},
into
"trans": {
"fr": "fr_chat_1",
"ru": "ru_ко́шка_1"
},
it seems to be working...
Now I put back all the items from my initial gist and convert the array of Russian strings into just a Russian string (no array). It doesn't work anymore...
I do believe there is something wrong in how non-ascii characters are handled in the values (and not keys contrary to the error displayed).
from zippyjson.
Okay, last additional info:
I think there is something strange going on in this function: static inline bool JNTCheck(ParsedJson::iterator i)
The comment says Check if there are any non-ASCII chars in the dictionary keys
, but I found out that it checks also values, not only keys.
Especially this part:
For any ASCII value, it returns false, but for Russian values it returns true
(lldb) p i.get_string() // English value - returns false
(const char *) $1 = 0x00007fec448172b8 "fr_chat_1"
(lldb) p i.get_string() // Russian value - returns true
(const char *) $2 = 0x00007fec448172cd "ru_\xffffffd0\xffffffba\xffffffd0\xffffffbe\xffffffcc\xffffff81\xffffffd1\xffffff88\xffffffd0\xffffffba\xffffffd0\xffffffb0_1"
What is the purpose of this check? If I deactivate it, everything is correctly parsed.
from zippyjson.
Which version of the library are you using, and how did you install it?
from zippyjson.
I am using 0.0.5 with Cocoapods.
from zippyjson.
yes, this is a legitimate bug. thank you for all the info! i've put a fix in, michaeleisel/ZippyJSONCFamily@100e71b
from zippyjson.
actually michaeleisel/ZippyJSONCFamily@2b60469
from zippyjson.
Related Issues (20)
- `michaeleisel/ZippyJSONCFamily` is missing commit for v1.2.4 HOT 2
- Are there dependencies blocking this library working on Linux? HOT 3
- Not enough bits to represent the passed value HOT 4
- ISO8601 with fractional seconds? HOT 2
- Warning: load of misaligned address HOT 1
- Failed to decode Decimal value HOT 1
- not able to parse an Int value that came as nil HOT 2
- First time of ZippyDecoding seems no improvement of CPU time cost HOT 6
- Not faster than JSONDecoder for specific case HOT 12
- Fix SwiftUI Previews (support arm64 on simulators) HOT 5
- ZippyJSON 1.2.5 depends on JJLISO8601DateFormatter 0.1.4 which does not exist HOT 2
- [ZippyJSONDecoder] Warning: fell back to using Apple's JSONDecoder. HOT 4
- Cannot compile with Xcode 14.1 and 14.2 due to missing JNTErrorInfo and JNTGetErrorInfo HOT 3
- Update release notes with Release Optimisations HOT 2
- Xcode Warning HOT 2
- Reduce size impact of ZippyJSON
- occurs crash on iOS 13.x HOT 11
- Adding Benchmark HOT 3
- Crash during allocation on iOS 13 when app is built with Xcode 15 HOT 5
- Missing required modules HOT 4
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 zippyjson.