Skip to content

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

Merged
wonday merged 1 commit intowonday:masterfrom
bernhardoj:fix/incorrect-character-decoding
Nov 18, 2024
Merged

Fix PDF failed to load when the file URI contains an encoded accented character#873
wonday merged 1 commit intowonday:masterfrom
bernhardoj:fix/incorrect-character-decoding

Conversation

@bernhardoj
Copy link
Copy Markdown
Contributor

The decoding of the URI is currently done using unescape.

path: unescape(uri.replace(/file:\/\//i, '')),

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.

@jjcoffee
Copy link
Copy Markdown

jjcoffee commented Oct 2, 2024

Possibly related issue #697. Also note that unescape is deprecated.

@wonday wonday merged commit 3764236 into wonday:master Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants