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

Copying characters on supplementary planes is broken #10529

Closed
a4lg opened this issue Feb 9, 2019 · 0 comments
Closed

Copying characters on supplementary planes is broken #10529

a4lg opened this issue Feb 9, 2019 · 0 comments

Comments

@a4lg
Copy link
Contributor

a4lg commented Feb 9, 2019

Attach (recommended) or Link to PDF file here: sample PDF file

Configuration:

  • Web browser and its version: Firefox 65.0 (64-bit)
  • Operating system and its version: Windows 10 1810 (64-bit)
  • PDF.js version: 2.0.943 (pdf.js prebuilt) and 2.1.97 (browser extension in Firefox 65.0)
  • Is a browser extension: Yes and No (see above)

Steps to reproduce the problem:

  1. Open sample PDF file
  2. Select all (Ctrl+A) and copy all the text (Ctrl+C)
  3. Paste to some text editor (with proper Unicode and emoji support)

What is the expected behavior? (add screenshot)

Following text (without notes) is copied:

OK: ☺ (Note: U+263A)
NG: 😃 (Note: U+1F603)
In the following example, hidden text (not supposed to be copied) is encoded:
𠁔𠁨𠁩𠁳𠀠𠁩𠁳𠀊𠁮𠁯𠁴𠀉𠁷𠁨𠁡𠁴𠀠𠁉𠀠𠁷𠁡𠁮𠁴𠁥𠁤𠀮
(Note: garbled Chinese text which I encoded a hidden string as U+00xx -> U+200xx)

What went wrong? (add screenshot)

Following text (without notes) is copied (Note: formatted for readability):

OK: ☺ (Note: U+263A)
NG:  (Note: U+0F603)
In the following example, hidden text (not supposed to be copied) is encoded:
This is not what I wanted.

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

I have a fix and will pull-request later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants