Re: escapes and JSON



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.
.



Relevant Pages

  • Special Characters in Query String
    ... now suddenly my mgmt says there are chances that Scrip ID(a ... But when I have special characters like then the value retrieved is ... wrong it just retrieves ABC and not complete ID ...
    (microsoft.public.dotnet.framework.aspnet)
  • Special Characters in Query String
    ... now suddenly my mgmt says there are chances that Scrip ID(a ... But when I have special characters like then the value retrieved is ... wrong it just retrieves ABC and not complete ID ...
    (microsoft.public.dotnet.framework.aspnet)
  • Special Characters in URL, how to handle?
    ... now suddenly my mgmt says there are chances that Scrip ID(a ... But when I have special characters like then the value retrieved is ... wrong it just retrieves ABC and not complete ID ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: URGENT: printer control from code
    ... You have to send special characters for reverse line. ... (avoiding Windows printing formating)? ... In case you didnt - there is sample code on MSDN site which show you how you ... >> Are you printing in dotmatrix or regime or graphics? ...
    (microsoft.public.dotnet.framework.windowsforms)

Loading