What is WebDNA
WebDNA and BioType
Download WebDNA
WebDNA resources
What is WebDNA
WebDNA and BioType
Download WebDNA
WebDNA resources
What is WebDNA
WebDNA and BioType
Download WebDNA
WebDNA resources
What is WebDNA
WebDNA and BioType
Download WebDNA
WebDNA resources
On 28 Nov. 2016, at 08:04, Tom Duke <tom@revolutionaries.ie> wrote:Hi all,Re-visting this as I am doing a lot of work =involving JSON and Javascript and escaping strings was doing my head =in.These functions work and only require one =[convertchars] pass. Thanks to the write up by Brian and Terry =here - http://www.webdna.us/page.dna?numero=3D183 - which =outlined that both the from, and to fields are first [unurl]'d when =using convert chars.It might help someone =else.- TomRef:=[function name=3Djson_escape][!]=Note Char =Hex Stored in WebDNA As=Quote " = %22 "=BackSlash \ %5C = \=ForwardSlash / / = /=Form Feed = %08 %08=Line Feed = %0A %0B=Carriage Return %0D = %0BHorizontal Tab = %09 %1D=%0B and %1D added to convert data read from a WebDNA db[/!][table =name=3DtabJSONESCAPE&fields=3Dfrom,to]%22\%22%5C\%5C/\/%08\b%0C\f%0A\n%0D\r%09\t%0B\n%1D\t[/table][!]=[/!][return][convertchars =table=3DtabJSONESCAPE][params_string][/convertchars][/return][!]---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list[/!][/function][text]test_string=3DL "John" & \ / Joanna ' + =Jane[/text][json_escape [test_string]]Result: L \"John\" & \\ \/ =Joanna ' + Jane[function name=3Djs_escape][!]=Note Char =Hex Stored in WebDNA As=Quote " = %22 "=Apostraphe ' = %27 = '=BackSlash \ %5C = \=ForwardSlash / / = /=Form Feed = %08 %08=Line Feed = %0A %0B=Carriage Return %0D = %0BHorizontal Tab = %09 %1D=%0B and %1D added to convert data read from a WebDNA db[/!][table =name=3DtabJSESCAPE&fields=3Dfrom,to]%22\%22%27\%27%5C\%5C/\/%08\b%0C\f%0A\n%0D\r%09\t%0B\n%1D\t[/table][!]=[/!][return][convertchars =table=3DtabJSESCAPE][params_string][/convertchars][/return][!][/!][/function][text]test_string=3DL "John" & \ / Joanna ' + =Jane[/text][js_escape [test_string]]Result: L \"John\" & \\ \/ =Joanna \' + Jane.To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us
|
On 28 Nov. 2016, at 08:04, Tom Duke <tom@revolutionaries.ie> wrote:Hi all,Re-visting this as I am doing a lot of work =involving JSON and Javascript and escaping strings was doing my head =in.These functions work and only require one =[convertchars] pass. Thanks to the write up by Brian and Terry =here - http://www.webdna.us/page.dna?numero=3D183 - which =outlined that both the from, and to fields are first [unurl]'d when =using convert chars.It might help someone =else.- TomRef:=[function name=3Djson_escape][!]=Note Char =Hex Stored in WebDNA As=Quote " = %22 "=BackSlash \ %5C = \=ForwardSlash / / = /=Form Feed = %08 %08=Line Feed = %0A %0B=Carriage Return %0D = %0BHorizontal Tab = %09 %1D=%0B and %1D added to convert data read from a WebDNA db[/!][table =name=3DtabJSONESCAPE&fields=3Dfrom,to]%22\%22%5C\%5C/\/%08\b%0C\f%0A\n%0D\r%09\t%0B\n%1D\t[/table][!]=[/!][return][convertchars =table=3DtabJSONESCAPE][params_string][/convertchars][/return][!]---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list[/!][/function][text]test_string=3DL "John" & \ / Joanna ' + =Jane[/text][json_escape [test_string]]Result: L \"John\" & \\ \/ =Joanna ' + Jane[function name=3Djs_escape][!]=Note Char =Hex Stored in WebDNA As=Quote " = %22 "=Apostraphe ' = %27 = '=BackSlash \ %5C = \=ForwardSlash / / = /=Form Feed = %08 %08=Line Feed = %0A %0B=Carriage Return %0D = %0BHorizontal Tab = %09 %1D=%0B and %1D added to convert data read from a WebDNA db[/!][table =name=3DtabJSESCAPE&fields=3Dfrom,to]%22\%22%27\%27%5C\%5C/\/%08\b%0C\f%0A\n%0D\r%09\t%0B\n%1D\t[/table][!]=[/!][return][convertchars =table=3DtabJSESCAPE][params_string][/convertchars][/return][!][/!][/function][text]test_string=3DL "John" & \ / Joanna ' + =Jane[/text][js_escape [test_string]]Result: L \"John\" & \\ \/ =Joanna \' + Jane.To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us
DOWNLOAD WEBDNA NOW!
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...