Bug: Encoding Problem


Recommended Posts



I have run into a small problem today when trying to list files in certain folder using get_files API method.

Thing is that I get in return something like this (raw data displayed by the browser):

{ "name": "Analogowe uk\u00c5\u0082ady elektroniczne (L)", "state": "created", "type": "folder" }
{ "download": 0, "have_pieces": 0, "name": "rozk\u00c5\u0082ad_roku.pdf", "size": 373406, "state": "created", "total_pieces": 12, "type": "file" } 

You can see there is part of (what it seems) badly encoded character (in this case one particular: ł or l with stroke). When tried to decode JSON using PHP json_decode() function it gave in return Å + one more not-printable character instread of what it should have.

It is not limited to this single character. Other entries I've tried also produces similar bug.


From what I could find in web (it is about another program, but the bug is the same - just in case it might be exactly the same problem): 

It looks like whatever process generated that JSON took UTF-8-encoded text and mistook it for Latin-1-encoded text.


Any help would be appreciated.

BitTorrent Sync version: 1.2.82 running on FreeBSD x64.

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.

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.