cloudinary-api icon indicating copy to clipboard operation
cloudinary-api copied to clipboard

extractPublicId function returns an encoded public id

Open AlexPagnotta opened this issue 2 years ago • 1 comments

Hello,

I noticed a weird behaviour when using the extractPublicId function, let's say we upload a file named TestÀ.png, we would get an url like this, with the special character encoded:

https://res.cloudinary.com/XXXXXX/image/upload/photos/TestA%C3%8C_XXXXX.png

Now if I check the public id in cloudinary I have photos/TestAÌ_XXXXX while with the extractPublicId function I get photos/TestA%C3%8C_XXXXX, so it's still encoded and different from the correct one.

This is not a big deal since I can decode the public ID pretty easily after I get it, but I was asking myself if it makes sense to include the decoding directly into the extract function, or if there is any downside on doing that.

AlexPagnotta avatar Apr 17 '23 13:04 AlexPagnotta

@AlexPagnotta I'm not sure we should include the decode process in the extractPublicID. Unless we test enough the regular cases when including the decoding inside extract function. Maybe you are interested in contributing for that?

Maybe add another function to decode and have it included as part of the package's functionalities?

mayashavin avatar May 09 '23 09:05 mayashavin