Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-03 Thread Hugh Myrie
Look at the sample text file and tell why the special characters differ. When I open the file in VSCode, the special characters in the first sample are highlighted. Could you explain why? On Wednesday, July 3, 2024 at 10:42:07 AM UTC-4 Hugh Myrie wrote: > Yes, PeterGo got it correctly. That is

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-03 Thread Hugh Myrie
Yes, PeterGo got it correctly. That is what I expect to see so I can post it to an API. On Tuesday, July 2, 2024 at 11:28:39 PM UTC-4 peterGo wrote: > Ian, > > Hugh Myrie might be expecting to see something like this: > > https://go.dev/play/p/7TlD5R1C0oX > > Peter > > On Tuesday, July 2, 2024 a

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread peterGo
Ian, Hugh Myrie might be expecting to see something like this: https://go.dev/play/p/7TlD5R1C0oX Peter On Tuesday, July 2, 2024 at 9:53:41 PM UTC-4 Ian Lance Taylor wrote: On Tue, Jul 2, 2024 at 5:29 PM Hugh Myrie wrote: When I change the %s to %q in the print function I see the special cha

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread Ian Lance Taylor
On Tue, Jul 2, 2024 at 5:29 PM Hugh Myrie wrote: > When I change the %s to %q in the print function I see the special > characters in their Hexadecimal representations. > > See below: > > 0011020240702\x1d0201758001030085245467021.00Y50072 > 202407020\x1cDG\x1cDI00

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread Hugh Myrie
Go code as plain text below: unc SendClaim(w http.ResponseWriter, r *http.Request) { // strEcho := "Halo" servAddr := tcpAddress type Resp struct { Status string `json:"status"` Reply string `json:"reply"` } type Claim struct { ClaimInfo string `json:"claiminfo"` } var params Claim erx := jso

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread Hugh Myrie
When I change the %s to %q in the print function I see the special characters in their Hexadecimal representations. See below: 0011020240702\x1d0201758001030085245467021.00Y50072 202407020\x1cDG\x1cDI00\x1cE7\x1cG1200 \x1cG2X \x1cG310\x1cG4E79

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread Ian Lance Taylor
1) Please send Go code as plain text, not as an image. Anybody can read plain text. Images are hard to read. Thanks. 2) What do you see if you change the %s to %q in the fmt.Printf call? Ian On Tue, Jul 2, 2024 at 3:40 PM Hugh Myrie wrote: > The original Go function is shown below. Initiall

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread Hugh Myrie
The original Go function is shown below. Initially, a JSON-encoded string is sent from the client. The first print function is used to view the output after decoding. func SendClaim(w http.ResponseWriter, r *http.Request) { // strEcho := "Halo" servAddr := tcpAddress type Resp str

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread Hugh Myrie
Copying the result to notepad confirms the missing special characters.. I'll try your suggestion. Thanks. Virus-free.www.avg.com

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread 'Dan Kortschak' via golang-nuts
On Mon, 2024-07-01 at 12:03 -0700, Hugh Myrie wrote: > I am trying to preserve special characters (group separators and > field separators) when reading the request body from a POST request. > > When I do a dumpRequest I am able to see the special characters (Hex > Format, for example: \x1c or \x0

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-01 Thread Ian Lance Taylor
On Mon, Jul 1, 2024 at 12:04 PM Hugh Myrie wrote: > > I am trying to preserve special characters (group separators and field > separators) when reading the request body from a POST request. > > When I do a dumpRequest I am able to see the special characters (Hex Format, > for example: \x1c or \x

[go-nuts] Preserving special characters when reading Go POST request body

2024-07-01 Thread Hugh Myrie
I am trying to preserve special characters (group separators and field separators) when reading the request body from a POST request. When I do a dumpRequest I am able to see the special characters (Hex Format, for example: \x1c or \x03). I am sending the data from the client as text/plain. I