Skip to content

Encoding issue with backticks #2258

@mmustala

Description

@mmustala

Hi,

I created a reduced example of when the encoding is not correct when using the backticks.

filename = "neliö" # Any string with multibyte chars should do
File.write(filename, "content")
`file -b --mime #{filename}`
# => "ERROR: cannot open `neliö' (No such file or directory)\n"

Passing the file name into the backticks with #{} is the key. When the file name is written directly into the code like this

`file -b --mime neliö`

there is no issues.

This relates to thoughtbot/cocaine#72 and thoughtbot/paperclip#1702

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions