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

Characters in string becomes Unicode literal notation #454

Open
ryym opened this issue Dec 20, 2023 · 0 comments
Open

Characters in string becomes Unicode literal notation #454

ryym opened this issue Dec 20, 2023 · 0 comments

Comments

@ryym
Copy link

ryym commented Dec 20, 2023

  • Ruby version: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
  • Rubyfmt git sha: e00d2ab (v0.10.0)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant