-
Notifications
You must be signed in to change notification settings - Fork 464
Wrong character encoding when using tagged templates #6750
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
Comments
there are three noticeable bugs in the result
|
No, that's just another block that returns at the end. It's fine.
You can get this to work for external tagged template functions: https://rescript-lang.org/try?version=v11.1.0&code=AIFwhg5hCmAmAq0C2AHANmE0AE0AeWATgHZhq54Bc2AFGIYWAJ4A8AziIQJbEQB8AGmz1GrAPp8AlNgC8fbB269Z2AET5VAKE0BhAPbE2etNAB0aPRBoBvfAANAOAR2AvpM1A However, right now there's a difference between external (bindings) and internal (written in ReScript) tagged template functions, where externals emit the tagged template syntax, but the internal ones are treated like regular functions. cc @tsnobip |
hmm shoot, this is quite surprising given all strings in rescript should now be in unicode. Given the original PR was quite old, maybe it reused some out-of-date logic around strings. |
Tagged templates seem to format special characters erroneously, for example
“
gets compiled into\xe2\x80\x9c
which gets parsed/printed/shown as�
Example playground file:
https://rescript-lang.org/try?version=v11.1.0&code=DYUwLgBCAeELwQBQGcwCcCWA7A5sgNBAPoCUAXBKprvAHwQDeAUBBAFLIB0AgmmgIYBPTgCsA9tgDqGMAAtEAIgWEq2PCSYBfJkwDCYrMjGhOwMTkQMYAA0A4BNc0kgA
Rescript version:
v11.1.0
The text was updated successfully, but these errors were encountered: