Closed unscriptable closed 10 years ago
e.g. these string evaluate to the same when they are different
jsEncode('content: "\e738"')
"content: \"e738\""
jsEncode('content: "e738"')
"content: \"e738\""
Did a bit of research / testing. It seems that js converts all backslash-escaped characters it doesn't recognize to unescaped values:
> '\e738'.charCodeAt(0)
101
How could this possibly work in the original module(s)? Doesn't the js engine convert '\e738' to 'e738'?
-- J
Ah yes but the example I gave was a css file! I guess you need to make a cssEncode function with different encoding logic. On 13 Aug 2013 00:42, "John Hann" notifications@github.com wrote:
Did a bit of research / testing. It seems that js converts all backslash-escaped characters it doesn't recognize to unescaped values:
'\e738'.charCodeAt(0)101
How could this possibly work in the original module(s)? Doesn't the js engine convert '\e738' to 'e738'?
-- J
— Reply to this email directly or view it on GitHubhttps://github.com/cujojs/curl/issues/207#issuecomment-22534110 .
http://www.merttol.com/articles/code/introduction-to-css-escape-sequences.html
On 13 August 2013 07:40, Gehan Gonsalkorale gehan.g@gmail.com wrote:
Ah yes but the example I gave was a css file! I guess you need to make a cssEncode function with different encoding logic. On 13 Aug 2013 00:42, "John Hann" notifications@github.com wrote:
Did a bit of research / testing. It seems that js converts all backslash-escaped characters it doesn't recognize to unescaped values:
'\e738'.charCodeAt(0)101
How could this possibly work in the original module(s)? Doesn't the js engine convert '\e738' to 'e738'?
-- J
— Reply to this email directly or view it on GitHubhttps://github.com/cujojs/curl/issues/207#issuecomment-22534110 .
Here you go! \ is an escape character in JS so just need to handle that properly I think
See this discussion: https://groups.google.com/d/msg/cujojs/Gt1Fof6tjOk/i5856nGUDWsJ