Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local PDF files can not be opened correctly in MS Edge when change default charset. #25

Open
fz0000 opened this issue Aug 27, 2021 · 1 comment

Comments

@fz0000
Copy link

fz0000 commented Aug 27, 2021

Steps:

  1. Change default charset to UTF-8 (or any charset).
  2. Check "Allow access to file URLs" in extension options.
  3. Open a local PDF file (e.g. D:\file-sample_150kB.pdf)with MS Edge.

Expected:

The PDF file should opened correctly.

Actual:

corrupted content.
image

Additional info:

This issue does NOT occur on online PDF files. (e.g. visit https://file-examples-com.github.io/uploads/2017/10/file-sample_150kB.pdf)

Environment:

Win10 x64
MS Edge 92.0.902.84

@fz0000 fz0000 changed the title local PDF files can not opened correctly when change default charset. Local PDF files can not be opened correctly in MS Edge when change default charset. Aug 27, 2021
@jinliming2
Copy link
Owner

Hi, this may not be fixed. Because I cannot assume the file type by file extension name.

It may be an HTML file with .pdf extension name.

Because a PDF file starts with ASCII characters: %PDF-, it's hard to tell it is a PDF file or a pure text file with some special encoding, unless I read more bytes and try to guess if it is a valid PDF file.

So, you may need to assume file type yourself.


I am developing a new version to support "default charset for specified domain" (#24), so after then you can set to do not change the character set for the filename ending with .pdf.

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

No branches or pull requests

2 participants