-
Notifications
You must be signed in to change notification settings - Fork 268
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
normalize issue when face special character #455
Comments
No, it is not possible.
As an example, that is what I get back from Google Chrome if I enter the url with
and if you would try to parse that URL using Ruby irb(main):017:0> URI("https://sothebysrealty.ca/insightblog/wp-content/uploads/2020/03/Featured-62-Ch-du-Boisé-Lac-Beauport-QC-sothebys-international-realty-canada-1440x570.jpg")
/Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/3.2.0/uri/rfc3986_parser.rb:20:in `split': URI must be ascii only "https://sothebysrealty.ca/insightblog/wp-content/uploads/2020/03/Featured-62-Ch-du-Bois\u00E9-Lac-Beauport-QC-sothebys-international-realty-canada-1440x570.jpg" (URI::InvalidURIError)
from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/3.2.0/uri/rfc3986_parser.rb:71:in `parse'
from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/3.2.0/uri/common.rb:193:in `parse'
from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/3.2.0/uri/common.rb:722:in `URI' |
I would like to re-open this issue. I think there is a misunderstanding. There is (at least) 2 ways to represent the letter « é » :
That how « http://ferrisson.com/wp-content/uploads/2014/04/2014-04-1-P.-P.-Côté-2.0-M.jpg » is correctly convert to « http://ferrisson.com/wp-content/uploads/2014/04/2014-04-1-P.-P.-Co%CC%82te%CC%81-2.0-M.jpg » |
Google Chrome is converting |
The link is an image coming from http://ferrisson.com/pierre-paul-cote-csq/ According to my Google Inspector, the link should be converted to http://ferrisson.com/wp-content/uploads/2014/04/2014-04-1-P.-P.-Co%CC%82te%CC%81-2.0-M.jpg I also post Safari Inspector since the conversion is more obvious. |
I copied from your message here on GitHub when I got I can also see the source code on http://ferrisson.com/pierre-paul-cote-csq/ referencing |
To be more clear, right click on the URL and "Copy Link Address" gave me |
Anyway, even if Chrome is supporting more representations I'm not sure we can do that in Addressable (see the previous comments in the thread) |
Hello guys, I got issue when I parse special character like é
with this code
Addressable::URI.parse(url).normalize
it will change é into %C3%A9 and this caused an error.
what I need is to parse it into UTF-8 Format become
e%CC%81
is is possible with this gem ?
example url:
https://sothebysrealty.ca/insightblog/wp-content/uploads/2020/03/Featured-62-Ch-du-Boisé-Lac-Beauport-QC-sothebys-international-realty-canada-1440x570.jpg
Instead of this current parsing condition:
https://sothebysrealty.ca/insightblog/wp-content/uploads/2020/03/Featured-62-Ch-du-Bois%C3%A9-Lac-Beauport-QC-sothebys-international-realty-canada-1440x570.jpg
-> wrongit should be become this UTF-8 format:
https://sothebysrealty.ca/insightblog/wp-content/uploads/2020/03/Featured-62-Ch-du-Boise%CC%81-Lac-Beauport-QC-sothebys-international-realty-canada-1440x570.jpg
-> correctThe text was updated successfully, but these errors were encountered: