Open mjguzdial opened 9 years ago
It would be very helpful if JES reported a line number when there is a Unicode character. We just get invalid syntax with no indication where. This has come up for us several times when students copy and paste code from a website or a pdf document. The typical culprit seems to be " characters in comments. It's very hard to track down.
Turns out not to be simple to give the user line numbers -- the check for Unicode is done within JES with just simple search/replace string functions. The error mechanism works with Jython. We can try to integrate the two, but probably not until the next version.
If you open a file with a unicode character in it in JES4.3, the character gets turned into something else, and the code runs. If you paste in a unicode character in JES4.3, it still runs.
But if there's any unicode character in JES5, even in a comment, you can't load the program. You get a syntax error.
Since I found that JES5 changed the code writing methods (thus breaking on Windows line ending characters), I'm betting that the code reading methods did, too, and that they aren't Unicode-safe. To be investigated later.