CJK shown as mess code in the comments in PDF opened in built-in PDF viewer

Steps to reproduce

  1. open a PDF in the MacOS built-in Preview APP, and create a comment with the following contents:
    你好 世界
    Hello world

  2. Attach this pdf file in an obsidian note and open it within obsidian (in built-in pdf viewer)

  3. try to read the comment.

Expected result

The content should be shown as
你好 世界
Hello world

Actual result

Chinese becomes mess code, in Obsidian built-in PDF viewer.

Environment

  • Operating system:
  • Debug info:

SYSTEM INFO:
Obsidian version: v1.0.3
Installer version: v1.0.3
Operating system: Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 21.6.0
Login status: logged in
Catalyst license: supporter
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 10
Restricted mode: off
Plugins installed: 24
Plugins enabled: 19
1: Advanced Tables v0.17.3
2: Breadcrumbs v3.6.4
3: Calendar v1.5.10
4: Contextual Typography v2.2.4
5: Copy Block Link v1.0.4
6: Dataview v0.5.47
7: Day Planner v0.5.8
8: Excalidraw v1.7.27
9: Local images v0.14.2
10: Enhancing Mindmap v0.2.4
11: Number Headings v1.10.0
12: Obsidian42 - BRAT v0.6.36
13: Outliner v4.1.1
14: Pandoc Plugin v0.4.1
15: Query Control v0.5.0
16: Smart Random Note v0.2.1
17: Style Settings v0.4.12
18: Templater v1.15.3
19: Kanban v1.5.1

RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.


Additional information

Notice that the Chinese in the text label can be shown correctly.

How do you comment/annotate a PDF in Obsidian? I’ve never done it. Is it a plugin?

sorry for the ambiguity.

I do the annotation of the PDF in the MacOS built-in Preview APP.

You were clear in number 1. :bowing_man: I misread. The original annotation was created in Preview.app on macOS.

edit: I tried with your “你好 世界 Hello world” as well as some mixed English and Japanese. I get the same result: 文字化け(corrupted text). Standard English characters seem OK, but an ö in Preview shows up as for me in Obsidian’s PDF viewer.

A macOS issue? A Preview.app issue with how non-English annotations are encoded/saved in the PDF? Obsidian? Lots of possible causes and probably tricky to track down.

Would be a good idea to change the post title to something more descriptive.

I also tried the PDF Expert. The comments created in that app corrupts as well.

The mess code issue in the old days used to be related with the encoding and decoding process. If this is still the cause, i think the built-in pdf viewer fails to recognize the CJK characters as UTF-8 in the comments.

Sorry for the title. It is a typo…

I thought i put a line in the title area…but it turns out that I forgot that i actually did not finish the title at all. :sweat_smile:

open the pdf in chrome, how does it look like?

I tried using Windows 11 and the Workintool PDF app to add a note to a PDF. I put Chinese, Japanese, Korean, and German in a PDF annotation note. Saved. Reopened. Looks fine in that app.

Opening the PDF in Edge or Vivaldi (Chromium) shows garbled text.

I would bet on an encoding problem. Don’t think there’s anything the Obsidian team can do about it.

I agree

Thank you for the detailed test.

So, the obsidian shares the same module with Chrome? And it is developed by other team?

Where can I report this bug?

https://bugs.chromium.org/p/pdfium/issues/detail?id=1098

https://bugs.chromium.org/p/chromium/issues/detail?id=785240&q=pdf%20viewer%20comment&can=2

https://bugs.chromium.org/p/chromium/issues/detail?id=1178715&q=pdf%20annotation&can=2

Oh, God… the issue in Chrome has been opened for more than 4 years… It is a sad news.

Thank you all the same.

the problem still exists now about v1.0.3
Langusges: Chinese Traditional

the built in pdf viewer will change in v1.3. this bug is deprecated.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.