Encoding Issue In Api Response


scus

Recommended Posts

I am trying to use the API to write a simple CLI. Unfortunately the API escapes unicode characters in a strange way.

 

Example:

[ { "dir": "\/home\/scus\/Universit\u00c3\u00a4t", "error": 0, "files": 10813, "indexing": 0, "secret": "--------------------------------", "size": 2211998011, "type": "read_write" } ]

I think the solution might be to not escape those characters (complies RFC 4627) and to send an "charset=utf-8" header with the response. Side note, the content-type header should say "application/json".

 

If it is necessary to escape non-ascii characters, the character ä for example should be escaped by "\uc3a4".

 

 

Regards,

scus

 

This bug is mentioned already here: http://forum.bittorrent.com/topic/25839-bug-returned-json-escapes-utf-8-in-messages/. But since this is the "Bug-Forum"...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.