-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
📝 Formatter replaces emojis #2604
Comments
I can't reproduce the issue on the playground, but this is what happens in neovim: I think it was fixed in #693 but I can't find why it happens |
webstorm has same problem |
@melMass are you using ALE to format or something else? I'm using ALE and see this as well, but it doesn't happen when formatting from the CLI |
looks like it might have something to do with the way neovim is exporting to stdout: before: console.log("⚠️ ") highlight the line with :'<,'>!bunx biome format --stdin-file-path=asdf.ts after: console.log("! "); but if I copy and paste that directly into the console it seems fine: ❯ echo 'console.log("⚠<fe0f> ")' | bunx biome check --apply --stdin-file-path=asdf.ts
console.log("⚠️ "); I'm not entirely sure where the |
ok it might still have something to do with biome not quite understanding what encoding stdin is in or something... :'<,'>!cat leaves it untouched, and: :'<,'>!cat > temp.ts && bunx biome check --apply temp.ts && cat temp.ts gives me: Checked 1 file in 2ms. Fixed 1 file.
console.log("⚠️ "); |
OK I think I figured it out. I believe biome is trying to strip ansi characters when it detects that the output is not interactive (e.g. to a pipe or a file). In this case its instead converting the emoji into a plain string. As a workaround, if you use A slightly different bug seems to be in the check mode where it prints the output first, then a message saying it would have printed the following content. So it's backwards and it's also reporting an error when there actually shouldn't be one. |
biome handles utf8 characters differently between files and stdin, and in some cases can replace emojis with ascii characters when using stdin refs: biomejs/biome#2604
I know we have the issue, but I am unable to replicate it, maybe because I have a shell that supports Ansi? I wished there was a consistent way - at least for me - to get an invalid output. BTW, if anyone wants to help, we use the |
Sorry I can't track exactly when/how but it's now working properly! |
biome handles utf8 characters differently between files and stdin, and in some cases can replace emojis with ascii characters when using stdin refs: biomejs/biome#2604
biome handles utf8 characters differently between files and stdin, and in some cases can replace emojis with ascii characters when using stdin refs: biomejs/biome#2604
I'm confused as to why this issue was closed, when it's still very much a problem in Webstorm. |
@marc-at-brightnight two reasons:
|
The issue still exists. I am using a helper.
|
Environment information
Configuration
Playground link
https://biomejs.dev/playground/?code=CgBlAHgAcABvAHIAdAAgAGMAbwBuAHMAdAAgAGkAbgBmAG8ATABvAGcAZwBlAHIAIAA9ACAAYwByAGUAYQB0AGUATABvAGcAZwBlAHIAKAAnADkhD%2F4nACwAIAAnAHkAZQBsAGwAbwB3ACcAKQAKAGUAeABwAG8AcgB0ACAAYwBvAG4AcwB0ACAAdwBhAHIAbgBMAG8AZwBnAGUAcgAgAD0AIABjAHIAZQBhAHQAZQBMAG8AZwBnAGUAcgAoACcAoCYP%2FicALAAgACcAbwByAGEAbgBnAGUAJwAsACAAJwB3AGEAcgBuACcAKQAKAGUAeABwAG8AcgB0ACAAYwBvAG4AcwB0ACAAZQByAHIAbwByAEwAbwBnAGcAZQByACAAPQAgAGMAcgBlAGEAdABlAEwAbwBnAGcAZQByACgAJwA92CXdJwAsACAAJwByAGUAZAAnACwAIAAnAGUAcgByAG8AcgAnACkACgBlAHgAcABvAHIAdAAgAGMAbwBuAHMAdAAgAHMAdQBjAGMAZQBzAHMATABvAGcAZwBlAHIAIAA9ACAAYwByAGUAYQB0AGUATABvAGcAZwBlAHIAKAAnAAUnJwAsACAAJwBnAHIAZQBlAG4AJwApAAoACgA%3D
Code of Conduct
The text was updated successfully, but these errors were encountered: