Re: escapes and JSON
- From: slebetman <slebetman@xxxxxxxxx>
- Date: Wed, 5 Dec 2007 17:51:26 -0800 (PST)
On Dec 5, 2:19 pm, Jeremy J Starcher <r3...@xxxxxxxxxxxxxxxxxxxxx>
wrote:
On Tue, 04 Dec 2007 14:45:17 -0800, pbd22 wrote:
[snip of some sample code]
OK, thanks.
SO, how do handle special case characters in my JSON strings?
I have keys such as "The Last Mermain (1994) - Limited Edition".
I agree with you, escape really messes things up. But, the
special characters are causing all sorts of probs with JSON
syntax.
Please help... deadline.
THanks.
Chances are, with that key like that, you have a design issue. I can't
see your code, so I'm not 100% certain -- but I strongly suggest you
look things over and go "Why?"
That said, if you are totally sure you want to do this, there might
be a better way to get what you are after. (Even with the best CRC
method there is still a (very small) chance collisions. Reading up
on hash tables and how to handle collisions isn't a bad idea.)
Well, one way of totally avoiding collisions is to simply base64
encode the key. If base64's '+' and '/' characters still give you
trouble then simply convert the key to hex which should handle
anything you care to throw at it. But if you do go the hex route
remember to be consistent and either ALWAYS use uppercase OR ALWAYS
use lowercase since keys are case sensitive.
.
- References:
- escapes and JSON
- From: pbd22
- Re: escapes and JSON
- From: slebetman
- Re: escapes and JSON
- From: pbd22
- Re: escapes and JSON
- From: Jeremy J Starcher
- escapes and JSON
- Prev by Date: Re: Adding events in a loop with arguments
- Next by Date: Re: Adding events in a loop with arguments
- Previous by thread: Re: escapes and JSON
- Next by thread: Re: escapes and JSON
- Index(es):
Relevant Pages
|
Loading