BUG Report: Special Characters inside Returned JSON String

Jump to solution
Community Explorer


I used curl to get a list of discussion topics (announcements).

The data was successfully returned. However, the returned string contains special characters, which BBEdit shown as a red reversed question mark.


There is one before the JSON string. This is fine, because I don't need the string before the JSON string.

special character.png

There is another one inside the JSON string.

special character2.png

This one breaks the string. As I did a regex search for \[\{.* and it stops at the reversed question mark. If I do regex search for \[\{.*\}\], it will fail the search, because the reversed question mark is there.

Any help appreciated!




When I copy and paste the reversed question mark to the search box of BBEdit, it is shown as \x{0D}, a carriage return.

I have no idea why the carriage return appears in the middle of the JSON string. It looks like one line of the string that is supposed to appear before the JSON string is inserted between the ID number.

special character3.png

it looks like the string after the first reversed question mark:
special character4.png


Edit 2:

I can first remove the Carriage Return and then do the regex research. But still, there are some extra numbers/spaces (the highlighted part in the screenshot below) inserted in the id number. The ID number is supposed to be "12047307". But "100 23887 " is inserted between "120" and "47307".

special character6.png


Edit 3:

The string inserted has random length. This time, it is this:

special character7.png

Another try:

special character8.png

It is always inserted at the same place though.


Looks like it is a bug?

Labels (1)
1 Solution
Community Explorer

Adding "-sS" to use silent mode has resolved the issue for me. Curl now returns only the JSON data.

View solution in original post