-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dafny fails with most languages when using UTF-16 escape sequences #5737
Comments
It should be possible to fix this in Rust by passing the previous char when decoding in
|
|
More information on the issue in Python: If my Dafny source code has strings outside the BMP (ex. My understanding is that
translated to Python with
However, Python will not interpret "𝟁" as a UTF-16 character by default:
Python is interpreting this as a single 4-byte UTF-32 character, and not as 2 2-byte UTF-16 characters.
So Dafny generates invalid code with I would expect that translating "𝟁" with
So, this seems to only be an issue with translating characters outside the BMP in strings in Dafny source code to Python (and possibly other runtimes). |
Dafny developers can work around this by replacing Unicode characters whose UTF-16 encodings lie outside the BMP in strings inside Dafny source code with UTF-16 surrogate pairs. |
Dafny version
4.7.0 (master as of 29 Aug, except for Rust which is latest feat_rust)
Code to produce this issue
Command to run and resulting output
What happened?
I would expect all languages to behave as cs.
What type of operating system are you experiencing the problem on?
Mac
The text was updated successfully, but these errors were encountered: