Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Unicode escaped characters in strings should probably stay unicode escaped #426

Open
sdarnell opened this issue Jun 10, 2015 · 1 comment
Labels

Comments

@sdarnell
Copy link
Contributor

I have some code which uses the unicode U+2028 character (LINE_SEPARATOR), with code along the lines of: str.IndexOf("\u2028")

However, Saltarelle seems to convert the character to a single unicode character in the source file.
One minor issue is that the resulting code is harder to read/debug because many unicode characters are hard to distinguish to the eye (e.g. all of the different white space variants).

But the main issue is that (at least Chrome) considers a LINE_SEPARATOR inside a string literal to be invalid syntax and 'throws a wobbly' (official technical term).

I have a work-around, which uses ((char)0x2028).ToString() but it would be best if Saltarelle could keep the unicode escaped characters escaped. Or at the very least, check for U+2028 and escape that character (there may be others as well).

@erik-kallen
Copy link
Contributor

Yes, you are right.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants