-
Notifications
You must be signed in to change notification settings - Fork 269
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
feat: Make sure that dafny run
always requests UTF-8 encoded output
#3049
Conversation
4119777
to
cbc58b4
Compare
Closes #2999 (but beware of encoding issues in Go and C++).
cbc58b4
to
673731b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whew, nice. I assume Go didn't need any changes because it already enforces UTF-8 output?
(e.g. `-Dfile.encoding=` for Java). This is in fact how `dafny run` operates: | ||
it uses language-specific flags and variables to enforce UTF-8 output regardless | ||
of the target language (but note that the C++ and Go backends currently have | ||
limited support for UTF-16 surrogates). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great but I feel it should also be in documentation specifically for the dafny run
command and not just for the print
statement. Perhaps http://dafny.org/dafny/DafnyRef/DafnyRef#256-using-dafny-from-the-command-line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
Well, not really; it's more that Go passes strings through without modification, so as long as we construct UTF-8 we're fine (which we do for since UTF-16 code units, but not for paired ones, hence the commented-out part of the test. |
Co-authored-by: Robin Salkeld <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0xF0 0x9F 0x9A 0x80
:)
Closes #2999 (but beware of encoding issues in Go and C++).