West Wind Internet and Client Tools
"\t" characters ending up in my JSON
Gravatar is a globally recognized avatar based on your email address. "\t" characters ending up in my JSON
  Gregg B
  All
  Nov 13, 2024 @ 11:18am

The characters "\t" are ending up in my JSON string. Like this:

"breeds": [
    "\tRedPoll",
    "\tSimmentalCross",
    "\tTigerstripe",
    "\tWhitePark"
  ],

I guess they represent tab characters, but I have no tabs in the data and I tried to strip chr(9) with STRTRAN() out just to make sure but no matter what I do I cannot get rid of them.

Any ideas?

Gravatar is a globally recognized avatar based on your email address. re: "\t" characters ending up in my JSON
  Rick Strahl
  Gregg B
  Nov 13, 2024 @ 08:54pm

Pretty sure there's tabs in your data, otherwise it wouldn't render this way. What are you serializing exactly and what code are you running?

Please post a repro scenario with a simple use case.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: "\t" characters ending up in my JSON
  Gregg B
  Rick Strahl
  Nov 15, 2024 @ 03:53am

You were right, as usual. I stripped the chr(9) out and it worked. I thought I had done that before but maybe I was so tired I missed something. Thanks, Rick.

© 1996-2024