Skip to content
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 for non-ascii character is inaccurate #5753

Closed
bobzhang opened this issue Oct 25, 2022 · 1 comment
Closed

comments for non-ascii character is inaccurate #5753

bobzhang opened this issue Oct 25, 2022 · 1 comment

Comments

@bobzhang
Copy link
Member

''-> Js.log

Generated JS output is

console.log(/* '\391' */25991);
@butterunderflow
Copy link
Contributor

This issue seems raised from here:
https://github.com/rescript-lang/rescript-compiler/blob/54e6a2bb061a61b34d8a9a2b1a37f68d1942f26d/jscomp/core/js_dump.ml#L633

When a char with a big encode value is passed to here(like '文', with encode 25991), format by %C will not get the encoded value back(given '\391' here).
Changing the payload char to int all the time, and providing a safer string_of_int_as_char-like function seems to solve this.
I'm working on this.

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

No branches or pull requests

2 participants