Closed chrisgrieser closed 10 months ago
This was also flagged in the Rome repository, and it seems it wasn't fixed.
Here's a possible reason of the bug: https://github.com/rome/tools/issues/3915#issuecomment-1339388916
I think that problem is the logic of converting strings to buffers.
Sometimes a Unicode "character" is made up of multiple Unicode scalar values, like the emoji1 in the above example or the βeΜβ character, but in Rust, char can only represent one unicode scalar.
The conversion logic here turns the second byte into a replacement_character, which causes the problem. I'm not sure why there is a need to make this conversion, but I think the unicode-segmentation might be helpful in solving this problem.
Relevant code: https://github.com/biomejs/biome/blob/f58df063cab89c72589cca6efc5b63e6cd4cc806/crates/biome_console/src/write/termcolor.rs#L150-L153
Environment information
What happened?
When using
biome format
via stdin, some emojis seem to break. This does not affect all emojis, and it does not affectbiome format --write
.(The different emoji sizes is a Wezterm-font-thing, I checked that the issue persists when opening the file in TextEdit.)
Expected result
Emojis not breaking
Code of Conduct