Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add full UTF-8 support to RPC #7892
(the univalue patch should be taken upstream - the RPC test and doc change should end up here. Posting it here for visibility and because this fixes an ancient issue: #2127. I think this is important to many non-English users)
This adds full UTF-8 support for both on input and output through JSON.
This also affects the GUI debug console.
When strings are passed directly (such as for getaccount's return argument) it works fine, but when they go through JSON formatting/parsing, it fails.
A test for this new functionality has been added to the
See the commit message of the first commit for details on what exactly had to be changed in univalue.
Concept ACK. Tests look good.
The patch goes to jgarzik/univalue as bitcoin/univalue is only for bitcoin related patches. (Still in the end we need to merge jgarzik/univalue into bitcoin/univalue because we use this as subtree.)
I don't think that's possible with just unicode?
ANSI escape sequences are a whole different story. In JSON objects they'll be escaped, but when printing strings (say, for
Nothing new here though: It's always been possible to pass any kind of crap characters from the server (just look at my OP) to bitcoin-cli, this just makes the round-trip sane and conform to UTF-8.
There are few direct tests for it, but all the other tests that parses JSON with strings in it is testing it.