mattn / mattn/mruby-json

Unicode problem after regenerating

Open
#47 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
33
Forks
31
PR merge metrics
No merged PRs in 30d

Description

A json string eg.

{"test": "\u4f60\u597d"}

parse it jsonObj = JSON.parse(s), then generate it newStr = JSON.generate(jsonObj)

the content of "newStr" is now

{"test": "你好"}

which is supposed to be identical with the original string( {"test": "\u4f60\u597d"} ).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the JSON.parse and JSON.generate sequence shown in the issue, using the escaped Chinese string as input. Trace the parser and generator entry points in mruby-json to find where the representation changes; done means regeneration preserves the original \u4f60\u597d escaping rather than emitting literal characters.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, ruby
Domain
backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.