Skip to content

Commit

Permalink
fix failed to load pdf when the file name contains accented character
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Oct 2, 2024
1 parent a6d812c commit 6a5aa0c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
File renamed without changes.
13 changes: 13 additions & 0 deletions patches/react-native-pdf+6.7.3+002+fix-incorrect-decoding.patch
Original file line number Diff line number Diff line change
@@ -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,
});
}

0 comments on commit 6a5aa0c

Please sign in to comment.