j.Args[1] = fmt.Sprintf("{\"encrypted_social_security_number\"=>\"%s\", \"first_name_soundex\"=>\"%s\",\"last_name_soundex\"=>\"%s\",\"address_soundex\"=>\"%s\",\"city_soundex\"=>\"%s\"}", essn ,fns,lns,as,cs)
That didn't work, so i thought maybe it was a peculiarity of Sprintf. So I split it out like this:
json = "{\"encrypted_social_security_number\"=>\"%s\", \"first_name_soundex\"=>\"%s\",\"last_name_soundex\"=>\"%s\",\"address_soundex\"=>\"%s\",\"city_soundex\"=>\"%s\"}"
j.Args[1] = fmt.Sprintf(json, essn ,fns,lns,as,cs)
Both of these create the following:
{"\encrypted_social_security_number\" etc.
How do I insert the quote without also inserting the escape slash?
I'm sure I'm missing something obvious!
Thanks,
Brian
> Brian,
>
> You are posting duplicate messages, 12 minutes apart. Why?
Apple Mail and Gmail infrequently get into a state where the mail sends but never leaves the drafts. I've had this happen 3 or 4 times over the past several years... I guess this was another. Apologies for the duplication!
>
> I don't see your problem.
If I had a dollar for every time I had a problem nobody else could see... :)
>
This problem turned out to be a double-encoding problem. I was assigning a json string to a variable, and the client library I'm using (that I also wrote) was json encoding the string.
Fortunately, I learned about the backtick method of creating character literals from your response. Thanks! It's nice to learn from our mistakes.
Brian