fables-tales / rubyfmt

Ruby Autoformatter!
MIT License
1.07k stars 50 forks source link

Characters in string becomes Unicode literal notation #454

Open ryym opened 8 months ago

ryym commented 8 months ago

Input file

# ok
# hello 😀

# ok
'hello'
'😀'

# NOT OK
'hello 😀'

Rubyfmt's output

# ok
# hello 😀

# ok
"hello"
"😀"

# NOT OK
"hello \u{1F600}"

This breaks because

It seems that Rubyfmt outputs non-ASCII characters in a string as Unicode literal notation when there are ASCII characters in the same string. The problem occurs for non-emoji characters too, such as あいうえお , 漢字 , 유니코드 , etc.