0

I have an Api method which returns json data. When I try to validate the json data using the online json validator: http://pro.jsonlint.com/, with the compare option, giving url in one section and the output of the url in another section, the url section shows an error and the section with data copied and pasted is validated.

What could be the issue here?

json_validation

UPDATE: I copied the 2 outputs into notepad and did a file compare, there is a non-printable character at the begining of the output from url.

D:\>fc j1.js j2.js

Comparing files j1.js and J2.JS

***** j1.js

{

    "responseStatus": null,

***** J2.JS

{

    "responseStatus": null,

*****

The content-type of the api response is "application/json; charset=utf-8".

zak
  • 310
  • 3
  • 19
  • It's really hard to debug or google anything from screen shots. Please copy/paste or transcribe the relevant text into the question. – tripleee Jan 02 '15 at 06:57
  • For proper diagnostics, a hex dump of the mystery bytes would be useful. – tripleee Jan 02 '15 at 07:02
  • `∩╗┐`‎ in‎ ‎[CP437](http://en.wikipedia.org/wiki/Code_page_437) would be represented by the bytes EF BB BF which is indeed the UTF-8 encoding of the Unicode BOM. – tripleee Jan 04 '15 at 10:24

1 Answers1

1

Without knowledge of your locale and character set, this is speculation; but the placement of the spurious text suggests that it may be a Unicode BOM. (Hmmm, six bytes? Two UTF-8 BOMs?)

tripleee
  • 175,061
  • 34
  • 275
  • 318
  • Thanks for the hint. Trying to implement the solution in this question: http://stackoverflow.com/questions/8073741/removing-utf-8-identifier-bom-from-response-sent-by-wcf – zak Jan 02 '15 at 14:30
  • If you can update the question with the requested information and/or details about your platform, we will hopefully be able to offer more detailed help. – tripleee Jan 02 '15 at 16:18