Closed oaksharks closed 6 years ago
Hi, I just ran into this problem and the solution was to encode the string as 'utf-8 after doing the json encode (and I guess you would do something similar for decoding if you need to decode).
Here's the patch for my use-case: https://github.com/davidshepherd7/anki-mode/commit/e052de184fb8eff9d382fb0d0dbb267777662f7f (I also switched to using a threading macro in the same commit, I hope it's still clear what the change was).
I got the idea from syohex's response to this issue, so that might be helpful too.
@davidshepherd7 Thanks for your reply . Just as your said I try to encode the response string:
(encode-coding-string response-json-data 'utf-8)
but it does not works then I tried the decode function:
(decode-coding-string response-json-data 'utf-8)
I just got the right result .
but I do not understand why the name of this function is decode-coding-string
.
I'm not really sure, but I think it's because it "decodes" a string which is coded in some non-emacs-native system (e.g. utf8) into emacs' native system.
I got that , it's already encoded in uft-8
but emacs just can not recognize that , so decode data by using utf-8
to bytes(or other thing) . Thanks again .
I have received the response with some chinese characters , but they are shown as numbers like
Is there any suggestions ?