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
Hi, When i do upload a file, i need to match the filename on some other string datas, but i got an error when using special caracters..
params received:
Parameters: {"name"=>"Mylène.png", "_cardbiz_session"=>"be1d5b7a2f27c7c4979ac4c16fe8fc82", "authenticity_token"=>"9vmJ02DjgKYCpoBNUcWwUlpxDXA8ddcoALHXyT6wrnM=", "asset"=>{"file"=># < ActionDispatch::Http::UploadedFile:0x007f94d38d37d0 @original_filename="Mylène.png", @content_type="image/png", @headers="Content-Disposition: form-data; name="asset[file]"; filename="Myle\xCC\x80ne.png"\r\nContent-Type: image/png\r\n", @tempfile=# < File:/var/folders/q5/yvy_v9bn5wl_s5ccy_35qsmw0000gn/T/RackMultipart20130805-51100-1eh07dp > >}, "id"=>"copie-de-sm"}
I log this:
* logger.debug file_name * logger.debug file_name.chars.map(&:to_s).inspect
Each time, same result:
* Mylène ["M", "y", "l", "e", "̀", "n", "e"] * Loïc ["L", "o", "i", "̈", "c"]
Thus my filename comparison fails and throw a weird error:
TypeError (no _dump_data is defined for class Binding)
I checked the encodings with loggers, utf-8 all the time. working under ruby 1.9.3, rails 3.2.14. Added #encoding: utf-8 in top of any file involved.
If you have any idea of what it could be...
The text was updated successfully, but these errors were encountered:
Seems to be linked to MACOSX.
https://www.ruby-forum.com/topic/4407424 refers to https://bugs.ruby-lang.org/issues/7267 MACOSX decomposing special characters into utf8-mac instead of utf-8... while you can't know the encoding of a file name, just presupose it.
Thanks to our Linux guy where it works properly (because he has a real OS). :)
Sorry, something went wrong.
No branches or pull requests
Hi,
When i do upload a file, i need to match the filename on some other string datas, but i got an error when using special caracters..
params received:
Parameters: {"name"=>"Mylène.png", "_cardbiz_session"=>"be1d5b7a2f27c7c4979ac4c16fe8fc82", "authenticity_token"=>"9vmJ02DjgKYCpoBNUcWwUlpxDXA8ddcoALHXyT6wrnM=", "asset"=>{"file"=># < ActionDispatch::Http::UploadedFile:0x007f94d38d37d0 @original_filename="Mylène.png", @content_type="image/png", @headers="Content-Disposition: form-data; name="asset[file]"; filename="Myle\xCC\x80ne.png"\r\nContent-Type: image/png\r\n", @tempfile=# < File:/var/folders/q5/yvy_v9bn5wl_s5ccy_35qsmw0000gn/T/RackMultipart20130805-51100-1eh07dp > >}, "id"=>"copie-de-sm"}
I log this:
Each time, same result:
Thus my filename comparison fails and throw a weird error:
I checked the encodings with loggers, utf-8 all the time.
working under ruby 1.9.3, rails 3.2.14. Added #encoding: utf-8 in top of any file involved.
If you have any idea of what it could be...
The text was updated successfully, but these errors were encountered: