It appears, in fact that any file I load via a straight filereader or
a url connection is having the back-slash character escaped so \n
becomes \\n for example if my source file had
var foo = "this is a pig \n oink, oink";
then loading the file into a string is actually
var foo = "this is a pig \\n oink, oink";
this can be demonstrated clearly with the following test:
locally
print("\\".length)
1
on gae
print("\\".length)
2
which means the script text was translated to
print("\\\\".length)
Why has this changed recently, or am I crazy, or both?
Thatcher
On Apr 23, 1:21 pm, Thatcher <[email protected]> wrote:
> Im currently getting escape sequences in rendered strings instead of
> the expected result (eg a newline or tab). It also breaks regular
> expression that are compiled from a string instead of regex literals
> (this is actually javascript source running with rhino on gae). I saw
> several posts that recently that are showing 1.3.3 has broken a lot of
> folks url mappings etc and it's making suspicious that my issue is
> related.
>
> I dont have any problems in the development server, only when I
> deploy, and since I have many existing apps built with the same tool
> chain I spent a couple days chasing my tail.
>
> Any ideas?
>
> Here's a concrete example, I used to get a json response like
> {
> "foo": "blah",
>
> but now I get
>
> {\n\t"foo": "blah",
>
> and the content-type is still text/javascript; charset=utf-8
>
> Any ideas?
> Thatcher
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group
> athttp://groups.google.com/group/google-appengine-java?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.