XML encoding

Is there a[n easy] way to encode a string with " and other special characters? Even if I could find the escape character (“"” in JS) I could replace it …

Not sure if this answers your question, but if you build an XML structure using roXMLElement, then call its GenXML() function, all the strings should be encoded properly in the result.

That might help, thank you! But in general, how can you escape double quotes in a string in Brightscript?

“SamZ” wrote:
That might help, thank you! But in general, how can you escape double quotes in a string in Brightscript?

Chr(34)

BTW, BrightScriptReferenceManual.pdf says:
GenXML(gen_header As String) As String but passing a string to the function throws an error! It turns out the parameter has to be Boolean! Further down the doc has this:
“GenXML() takes one parameter (boolean) that indicates whether the generated xml should have the <?xml …> tag at the top.”

“SamZ” wrote:
BTW, BrightScriptReferenceManual.pdf says:
GenXML(gen_header As String) As String but passing a string to the function throws an error! It turns out the parameter has to be Boolean!
OK, this is kinda ridiculous: it has been almost two years and this has not been corrected. I just faced it

[upload|8zi/KN+2eojGBqtigC3Iyw==]

Glad searching the forum for GenXML pulled this info.

Two years! Seriously Roku dudes, fix it.