Skip to content

Characters in string becomes Unicode literal notationΒ #454

@ryym

Description

@ryym
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions