From 6a5aa0cb94156360ba568b090b9941fe2628a3c7 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 2 Oct 2024 17:08:28 +0800 Subject: [PATCH] fix failed to load pdf when the file name contains accented character --- ...tch => react-native-pdf+6.7.3+001+initial.patch} | 0 ...ative-pdf+6.7.3+002+fix-incorrect-decoding.patch | 13 +++++++++++++ 2 files changed, 13 insertions(+) rename patches/{react-native-pdf+6.7.3.patch => react-native-pdf+6.7.3+001+initial.patch} (100%) create mode 100644 patches/react-native-pdf+6.7.3+002+fix-incorrect-decoding.patch diff --git a/patches/react-native-pdf+6.7.3.patch b/patches/react-native-pdf+6.7.3+001+initial.patch similarity index 100% rename from patches/react-native-pdf+6.7.3.patch rename to patches/react-native-pdf+6.7.3+001+initial.patch diff --git a/patches/react-native-pdf+6.7.3+002+fix-incorrect-decoding.patch b/patches/react-native-pdf+6.7.3+002+fix-incorrect-decoding.patch new file mode 100644 index 000000000000..1061335b85fe --- /dev/null +++ b/patches/react-native-pdf+6.7.3+002+fix-incorrect-decoding.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/react-native-pdf/index.js b/node_modules/react-native-pdf/index.js +index bea7af8..bf767c9 100644 +--- a/node_modules/react-native-pdf/index.js ++++ b/node_modules/react-native-pdf/index.js +@@ -233,7 +233,7 @@ export default class Pdf extends Component { + } else { + if (this._mounted) { + this.setState({ +- path: unescape(uri.replace(/file:\/\//i, '')), ++ path: decodeURIComponent(uri.replace(/file:\/\//i, '')), + isDownloaded: true, + }); + }