react-native-pdf icon indicating copy to clipboard operation
react-native-pdf copied to clipboard

Fix PDF failed to load when the file URI contains an encoded accented character

Open bernhardoj opened this issue 1 year ago • 1 comments

The decoding of the URI is currently done using unescape. https://github.com/wonday/react-native-pdf/blob/d545ff27b49850c773f6c443dfc65891881c0ed2/index.js#L238

However, this fails if the URI contains an encoded accented name, for example:

ù is encoded to %C3%B9, but decoding it using unescape gives ù.

This PR replaces unescape with decodeURIComponent.

bernhardoj avatar Oct 02 '24 08:10 bernhardoj

Possibly related issue https://github.com/wonday/react-native-pdf/issues/697. Also note that unescape is deprecated.

jjcoffee avatar Oct 02 '24 09:10 jjcoffee