We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This exception may occur under, for example, Japanese Windows environment.
In the case, the encoding of the string got via ARGV may be not UTF-8 but Windows 31J (a.k.a. Codepage 932).
# demo1.rb p ARGV.first.encoding
> ruby demo1.rb foo #<Encoding:Windows-31J>
Generally, two strings which do not contain any non-ASCII character can be joined, even if one is in UTF-8 and the other is in Windows 31J.
p ["foo".encode("UTF-8"), "bar".encode("CP932")].join # Not raised.
However, if these strings contain a non-ASCII character, Encoding::CompatibilityError occurs.
p ["あ".encode("UTF-8"), "う".encode("CP932")].join # => `join': incompatible character encodings: UTF-8 and Windows-31J (En coding::CompatibilityError)
So, if one of the file paths and a cell value of the CSV have any non-ASCII character, the same exception may occur here.
I think that converting the file paths into UTF-8 may solve the problem.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This exception may occur under, for example, Japanese Windows environment.
In the case, the encoding of the string got via ARGV may be not UTF-8 but Windows 31J (a.k.a. Codepage 932).
Generally, two strings which do not contain any non-ASCII character can be joined, even if one is in UTF-8 and the other is in Windows 31J.
However, if these strings contain a non-ASCII character, Encoding::CompatibilityError occurs.
So, if one of the file paths and a cell value of the CSV have any non-ASCII character, the same exception may occur here.
I think that converting the file paths into UTF-8 may solve the problem.
The text was updated successfully, but these errors were encountered: