Another approach: https://play.golang.org/p/vTVE3nrGs86

On Friday, 28 May 2021 at 19:00:11 UTC+1 seank...@gmail.com wrote:

> maybe something like https://play.golang.org/p/z-Yp4bh7jto
>
> On Friday, May 28, 2021 at 6:59:34 PM UTC+2 manlio....@gmail.com wrote:
>
>> On Friday, May 28, 2021 at 6:26:46 PM UTC+2 sharathc...@gmail.com wrote:
>>
>>> QuoteToAscii converts non printable characters to \xd  , but i literally 
>>> want the same value .
>>>
>>> QuoteToAscii will not produce the json compatible string or will not 
>>> escape string in true sense like 
>>>
>>> Conversion of "abc\u001d" will be converted to "abc\x1d" which is not 
>>> compatible with json string
>>>
>>>
>>> If there is no built in cooked function ,
>>>
>>> Can you please through some pointers how to implement on own , i am not 
>>> able to figure it out ...
>>>
>>
>> See 
>> https://github.com/golang/go/blob/ccd9784edf/src/encoding/json/encode.go#L1031
>>  
>> as an example.
>>
>> Also, note that the language name is Go, not Golang.
>>
>>
>> Manlio
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f55ca739-51e4-4f14-acd5-ab3acf2b8274n%40googlegroups.com.

Reply via email to