-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
util.url doesn't work for Beyoncé etc. (utf encoding) #147
Comments
Hi @johnelliott, Thank you for reporting about this. It seems that there are two different characters that are used here (although visually they look identical), one of them is handled correctly, the other isn't:
I've passed it on to our team to have a look at it. |
Hi @johnelliott, Could you please make sure you're using the latest release of this library? I look forward to your updates. |
@nadavofi Thank you :) We'll compare this code and see if that helps us out. |
The URL function is giving us issues with image file names where there are UTF characters like cedilla and grave accents.
Problem:
The current function results in
Beyonc%327e%301_kofryc
, where thec
inBeyonc
is untouched. This URIDecodes toBeyonc27e01_kofryc
, which isn't the correct public_id.The desired end url should contain a public_id something like
Beyonc%CC%A7e%CC%81_kofryc
which you can URIDecode back into the original public_id.Steps to reproduce:
Try with a
public_id
like Beyonçé, and stop the debugger as it's looping over the characters in the string: https://github.com/cloudinary/cloudinary_npm/blob/master/src/utils.coffee#L598It seems that because the regex doesn't match the

c
of theç
we're trying to represent, by the time you process the cedilla, the chance for encoding thec
and the cedilla together into%CC%A7
has passed:Normalizing the string before sending it to the function doesn't appear to fix the issue.
Helpful links about unicode normalization:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
http://www.unicode.org/reports/tr15/tr15-29.html
The text was updated successfully, but these errors were encountered: