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

Allow unicode chars, force_encoding('UTF-8') #68

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jondkinney
Copy link

I was getting errors in some files that had unicode characters in them. This seems to fix/ignore that and let the files be formatted still.

Command failed: erb-format --tailwind-output-path app/assets/builds/tailwind.css --stdin-filename "/Users/jon/Code/Seckret-Project/app/views/home/index.html.erb" --print-width 120
/Users/jon/.local/share/mise/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/erb-formatter-0.7.3/lib/erb/formatter.rb:101:in `gsub!': invalid byte sequence in US-ASCII (ArgumentError)

    @source.gsub!(ERB_PLACEHOLDER) { |tag| build_uid[].tap { |uid| pre_placeholders[uid] = tag } }
                  ^^^^^^^^^^^^^^^
	from /Users/jon/.local/share/mise/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/erb-formatter-0.7.3/lib/erb/formatter.rb:101:in `initialize'
	from /Users/jon/.local/share/mise/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/erb-formatter-0.7.3/lib/erb/formatter/command_line.rb:101:in `new'
	from /Users/jon/.local/share/mise/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/erb-formatter-0.7.3/lib/erb/formatter/command_line.rb:101:in `block in run'
	from /Users/jon/.local/share/mise/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/erb-formatter-0.7.3/lib/erb/formatter/command_line.rb:97:in `each'
	from /Users/jon/.local/share/mise/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/erb-formatter-0.7.3/lib/erb/formatter/command_line.rb:97:in `run'
	from /Users/jon/.local/share/mise/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/erb-formatter-0.7.3/exe/erb-format:5:in `<top (required)>'
	from /Users/jon/.local/share/mise/installs/ruby/3.3.4/bin/erb-format:25:in `load'
	from /Users/jon/.local/share/mise/installs/ruby/3.3.4/bin/erb-format:25:in `<main>'

@elia elia force-pushed the feature/support-unicode-chars branch from 55edcf0 to 57761b5 Compare January 29, 2025 14:57
@elia
Copy link
Member

elia commented Jan 29, 2025

Hey, I tried to add a spec that would fail with utf8 chars, can you please share an example of a template that would fail?
I'll be happy to add it and merge.

@elia elia changed the title fix: allow unicode chars, force_encoding('UTF-8') llow unicode chars, force_encoding('UTF-8') Jan 29, 2025
@elia elia changed the title llow unicode chars, force_encoding('UTF-8') Allow unicode chars, force_encoding('UTF-8') Jan 29, 2025
@elia elia added the question Further information is requested label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants