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

String.raw Iterator encoding error #18115

Open
nwind opened this issue Mar 12, 2025 · 0 comments · May be fixed by #15047
Open

String.raw Iterator encoding error #18115

nwind opened this issue Mar 12, 2025 · 0 comments · May be fixed by #15047
Labels
bug Something isn't working bundler Something to do with the bundler

Comments

@nwind
Copy link

nwind commented Mar 12, 2025

What version of Bun is running?

1.2.4+fd9a5ea66

What platform is your computer?

Darwin 24.1.0 x86_64 i386

What steps can reproduce the bug?

When String.raw contain not ASCII text like chinese,Iterator are wrong,like this

const text = String.raw`a中`;

for (const char of text) {
  console.log(char);
}

What is the expected behavior?

Node output is:

a
中

What do you see instead?

Bun output is:

a
\
u
4
E
2
D

Additional information

I also try to using jsc in /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Helpers/jsc to run this code (change console.log to debug), the output are correct

--> a
--> 中

So I thought the bug is in bun.

@nwind nwind added bug Something isn't working needs triage labels Mar 12, 2025
@RiskyMH RiskyMH added node.js Compatibility with Node.js APIs web-api Something that relates to a standard Web API and removed needs triage labels Mar 12, 2025
@pfgithub pfgithub linked a pull request Mar 12, 2025 that will close this issue
3 tasks
@pfgithub pfgithub added bundler Something to do with the bundler and removed node.js Compatibility with Node.js APIs web-api Something that relates to a standard Web API labels Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bundler Something to do with the bundler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants