Skip to content

Incompatible character encoding error #377

Description

@avdv

[...]/colorls/core.rb:86:in `join': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)

I am not fluent in ruby I am more in shell script I understand the probleme is probably the «é» character in /home/luxcium/Téléchargements

Output:

/home/luxcium/Téléchargements
Traceback (most recent call last):
        12: from /home/luxcium/bin/colorls:23:in `<main>'
        11: from /home/luxcium/bin/colorls:23:in `load'
        10: from /home/luxcium/.gem/ruby/gems/colorls-1.4.1/exe/colorls:26:in `<top (required)>'
         9: from /home/luxcium/.gem/ruby/gems/colorls-1.4.1/lib/colorls/flags.rb:43:in `process'
         8: from /home/luxcium/.gem/ruby/gems/colorls-1.4.1/lib/colorls/flags.rb:43:in `each_with_index'
         7: from /home/luxcium/.gem/ruby/gems/colorls-1.4.1/lib/colorls/flags.rb:43:in `each'
         6: from /home/luxcium/.gem/ruby/gems/colorls-1.4.1/lib/colorls/flags.rb:48:in `block in process'
         5: from /home/luxcium/.gem/ruby/gems/colorls-1.4.1/lib/colorls/flags.rb:48:in `new'
         4: from /home/luxcium/.gem/ruby/gems/colorls-1.4.1/lib/colorls/core.rb:29:in `initialize'
         3: from /home/luxcium/.gem/ruby/gems/colorls-1.4.1/lib/colorls/core.rb:86:in `init_contents'
         2: from /home/luxcium/.gem/ruby/gems/colorls-1.4.1/lib/colorls/core.rb:86:in `map!'
         1: from /home/luxcium/.gem/ruby/gems/colorls-1.4.1/lib/colorls/core.rb:86:in `block in init_contents'
/home/luxcium/.gem/ruby/gems/colorls-1.4.1/lib/colorls/core.rb:86:in `join': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
/home/luxcium/Téléchargements
 

My shell function in ZSH:

    function ld() {
        (
            local mypath="${@:-$(pwd)}"
            echo ''
            builtin cd "${mypath}"
            pw
            colorls -lA --sd -d "${mypath}"
            pw
            echo "${mypath}"
        )
    }

My locale:

locale      
LANG=fr_CA.UTF-8
LC_CTYPE="fr_CA.UTF-8"
LC_NUMERIC=fr_CA.UTF-8
LC_TIME=fr_FR.UTF-8
LC_COLLATE=fr_CA.UTF-8
LC_MONETARY=fr_CA.UTF-8
LC_MESSAGES="fr_CA.UTF-8"
LC_PAPER="fr_CA.UTF-8"
LC_NAME="fr_CA.UTF-8"
LC_ADDRESS="fr_CA.UTF-8"
LC_TELEPHONE="fr_CA.UTF-8"
LC_MEASUREMENT=fr_CA.UTF-8
LC_IDENTIFICATION="fr_CA.UTF-8"
LC_ALL=

Originally posted by @Luxcium in #242 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions