Sending " character via URScript socket_send_line function

Hello forum and URCap team,

I am facing a problem, where my URCap produces lexer errors I cannot explain.

I want to send a string containing " characters to a server socket. The server expects the following text (Note the " characters around Value 0):

values=["Value 0",0,0,0,0,1,1,1,1]

My scriptWriter generates the following code and escapes the inner " characters, which I think should do the job:

res = socket_send_line("values=[\"Value 0\",0,0,0,0,1,1,1,1]","server")

When starting a sample program containing this node, the following error message pops up (Note, there are no escaping characters!):

Lexer exception on line 148: res = socket_send_line(“values=["Value 0",0,0,0,0,1,1,1,1]”,“server”)

Under the Advanced view (script) section of the popup it highlights the part of the command beginning with the second escaped " character:

…_send_line("values=[\"Value 0 \“,0,0,0,0,1,1,1,1]”,"ser…

Note: in this advanced view, the escaping characters around Value 0 are there again!

Now can you tell me how it is possible to send strings with escaped " characters via socket_send_line?

Thanks a lot in advance and best regards

Steffen

the last I knew, you cannot send " characters with URScript. We do this in our URCaps and you have to embed single quotations ’ ’ and convert them on the server side. See this post below about sending json strings which encounters a similar issue:

Thanks a lot for this hint, this workaround serves my needs.

Best regards,

Steffen