-
Notifications
You must be signed in to change notification settings - Fork 188
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
ColorLS: incompatible character encodings: UTF-8 and ASCII-8BIT #2091
Comments
Is this in reference to another issue? |
I wanted to say that all failures there are similar and the one I posted just an example |
I reduced to a simple test-case. string = "Gl\xC3\xBCck".force_encoding(Encoding::ASCII_8BIT)
encoded = string.encode(Encoding.find('filesystem'), Encoding.default_external, invalid: :replace, undef: :replace)
p encoded.encoding
# MRI => #<Encoding:UTF-8>
# TruffleRuby => #<Encoding:ASCII-8BIT> |
In Chris' test-case, if we remove "Encoding.default_external" we do get encoded.encoding = #Encoding:UTF-8; since "Encoding.default_external" is #Encoding:UTF-8, same as the destination encoding, the TR code skips the conversion step when destination encoding is the same as given source encoding. Unsure if ignoring user-inputted source encoding would break anything (probably?) and what the fix would be in that case. However, even when source encoding is properly set, encoded = "Glück" in MRI and "Gl��ck", so something in Encoding::Converter also needs to be fixed. |
@LillianZ thank you |
ColorLS fails with similar issues:
Full logs are here
The text was updated successfully, but these errors were encountered: