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

Incompatible character encodings #449

Closed
1 of 5 tasks
ArtyomFR opened this issue Mar 23, 2021 · 2 comments · Fixed by #450
Closed
1 of 5 tasks

Incompatible character encodings #449

ArtyomFR opened this issue Mar 23, 2021 · 2 comments · Fixed by #450

Comments

@ArtyomFR
Copy link

Description

There is a new bug with incompatible character in v1.4.4

❯ locale
LANG=fr_FR.UTF-8
LC_CTYPE=fr_FR.UTF-8
LC_NUMERIC=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
LC_COLLATE=fr_FR.UTF-8
LC_MONETARY=fr_FR.UTF-8
LC_MESSAGES=fr_FR.UTF-8
LC_PAPER=fr_FR.UTF-8
LC_NAME=fr_FR.UTF-8
LC_ADDRESS=fr_FR.UTF-8
LC_TELEPHONE=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8
LC_IDENTIFICATION=fr_FR.UTF-8
LC_ALL=
❯ colorls /home/artyom/Vidéos
Traceback (most recent call last):
	13: from /usr/bin/colorls:23:in `<main>'
	12: from /usr/bin/colorls:23:in `load'
	11: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/exe/colorls:26:in `<top (required)>'
	10: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/flags.rb:31:in `process'
	 9: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/flags.rb:83:in `process_args'
	 8: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/flags.rb:83:in `each'
	 7: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/flags.rb:86:in `block in process_args'
	 6: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/core.rb:51:in `ls_dir'
	 5: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/core.rb:51:in `map!'
	 4: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/core.rb:51:in `block in ls_dir'
	 3: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/fileinfo.rb:29:in `dir_entry'
	 2: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/fileinfo.rb:29:in `new'
	 1: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/fileinfo.rb:17:in `initialize'
/usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/fileinfo.rb:17:in `join': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)

This happen only if the desired path directory contain a file/directory with a special character.
It does not happen if I 'colorls' without path and I'm already in the directory:

❯ cd /home/artyom/Vidéos
❯ colorls
      Films/      Séries/

It does not happen if the wanted directory contain no file/directory with special character:

❯ colorls /home/artyom/Téléchargements

   Nothing to show here
❯ touch /home/artyom/Téléchargements/test
❯ colorls /home/artyom/Téléchargements
      test 
❯ touch /home/artyom/Téléchargements/tést
❯ colorls /home/artyom/Téléchargements
Traceback (most recent call last):
	13: from /usr/bin/colorls:23:in `<main>'
	12: from /usr/bin/colorls:23:in `load'
	11: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/exe/colorls:26:in `<top (required)>'
	10: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/flags.rb:31:in `process'
	 9: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/flags.rb:83:in `process_args'
	 8: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/flags.rb:83:in `each'
	 7: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/flags.rb:86:in `block in process_args'
	 6: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/core.rb:51:in `ls_dir'
	 5: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/core.rb:51:in `map!'
	 4: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/core.rb:51:in `block in ls_dir'
	 3: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/fileinfo.rb:29:in `dir_entry'
	 2: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/fileinfo.rb:29:in `new'
	 1: from /usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/fileinfo.rb:17:in `initialize'
/usr/lib/ruby/gems/2.7.0/gems/colorls-1.4.4/lib/colorls/fileinfo.rb:17:in `join': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
  • Relevant Issues : Incompatible character encoding error #377
  • Relevant PRs : (none)
  • Type of issue :
    • Installation
    • Font-related
    • Feature request
    • Bug in existing feature
    • Developer mode : Code quality / Tests / Documentation
avdv added a commit to avdv/colorls that referenced this issue Mar 24, 2021
@avdv avdv closed this as completed in #450 Mar 24, 2021
@avdv
Copy link
Collaborator

avdv commented Mar 24, 2021

Hi.

This should be fixed (again) in #450. Please try the pre-release (with gem update colorls --pre) and report back if it fixes the problem for you.

@ArtyomFR
Copy link
Author

It's good, using the patch in pre-release seems to solve the issue.
Thanks!

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

Successfully merging a pull request may close this issue.

2 participants