Skip to content

Commit

Permalink
Merge pull request #50043 from bernhardoj/fix/49449-can't-read-pdf-wi…
Browse files Browse the repository at this point in the history
…th-accented-name

Fix failed to load pdf when the file name contains accented character
  • Loading branch information
neil-marcellini authored Oct 2, 2024
2 parents d716595 + 6a5aa0c commit 06c8bb5
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 06c8bb5

Please sign in to comment.