You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
raw tagged template literals show escapes for non ascii text #8745
Reacted by Drew LeSueur, Never Used Github, Javien Lee, Shotaro Nakamura, moton-03, a_p_u_r_o, Josh Ghoulberg 👻, Brian Kim, Javi Aguilar, Ilya Semenov and 5 more
Still reproducible with Bun 1.4.0 (34cbb9a), Windows x64.
Here is a minimal BDD-style regression:
import{describe,expect,test}from"bun:test";describe("String.raw with non-ASCII source text",()=>{test("Given a literal check mark, when String.raw evaluates it, then the character is preserved",()=>{expect(String.raw`✓`).toBe("✓");});});
Bun 1.4.0 fails with a received value of "\\u2713"; Node preserves "✓".
Bun emits a JavaScript-style \\u2713 escape. CSS does not interpret that as a JavaScript Unicode escape, so the browser displays u2713 instead of the check mark. Switching that stylesheet to an ordinary template literal is an effective application-level workaround.
Activity
drewlesueur commentedon Apr 5, 2024
A similar issue (#9891) seems to be fixed in v1.1.1, however this specific issue is still there.
fix(transpiler): preserve non-ASCII characters in raw template literals
String.rawdoes not align with Node.js and browsers when escaping unicode #27193 as a duplicate of this issuefix: preserve unicode in tagged template literals and regex source
Preserve non-ASCII in tagged template literals and regex source
Preserve non-ASCII in tagged template literals and regex source
Preserve non-ASCII in tagged template literals and regex source
Preserve non-ASCII in tagged template literals and regex source
Preserve non-ASCII in tagged template literals and regex source
Preserve non-ASCII in tagged template literals and regex source
Preserve non-ASCII in tagged template literals and regex source
Preserve non-ASCII in regex .source and tagged template .raw
Preserve non-ASCII in regex .source and tagged template .raw
Preserve non-ASCII in regex .source and tagged template .raw
$) inserting Unicode escapes when not needed #18859 as a duplicate of this issuehishtadlut commentedon Aug 23, 2026
Still reproducible with Bun 1.4.0 (34cbb9a), Windows x64.
Here is a minimal BDD-style regression:
Bun 1.4.0 fails with a received value of
"\\u2713"; Node preserves"✓".This has a visible CSS consequence. Given:
Bun emits a JavaScript-style
\\u2713escape. CSS does not interpret that as a JavaScript Unicode escape, so the browser displaysu2713instead of the check mark. Switching that stylesheet to an ordinary template literal is an effective application-level workaround.franciscop commentedon Aug 23, 2026
I just found this by exactly hitting the bug with
(String.raw`✓`)as well, happy to see it's already reported 🙏