【历史讨论】GoldenDict-ng 基于Qt5.15.2/Qt6.X版本

多謝。刪除了生成的files目錄,用 Chrome 打開 html,有的有亂碼,有的沒有亂碼(出現和不出現亂碼的詞典和直接從 GD 複製粘貼時相似)。
而用 Safari 打開 單獨的 html,所有詞典複製後都不出現亂碼。

也就是說是詞典的html文件裡。不過我不懂碼,看不出問題來。我把 html 傳給 AI Claude,它也說不出具體問題來。我把 html 傳在這裡,能不能幫忙大概看一下有無明顯問題?

Claude:

I looked over the HTML code you provided and there are a few potential issues that could be causing text corruption when pasting into TextEdit:

  1. The HTML contains a mix of character encodings. Some parts seem to use UTF-8 encoding while other parts use legacy encodings like Windows-1252. Mixing encodings can cause issues.
  2. There are some Chinese characters and text which may not be supported well by TextEdit’s encoding. TextEdit may default to MacRoman encoding which doesn’t include Chinese characters.
  3. The HTML contains a lot of styling and formatting with inline CSS. This rich text formatting can sometimes get corrupted when pasting into a plain text editor.
  4. I notice the HTML is loading various fonts including Chinese fonts like KaiXinSong. If these fonts are not installed on your system, it could cause the characters to display incorrectly.
  5. There are some non-standard HTML entities like &c. Those may not copy over properly.

Some potential fixes:

  • Convert the HTML to plain text before pasting into TextEdit. This will strip styling.
  • Make sure you are saving the documents in TextEdit with UTF-8 encoding.
  • Install any required fonts used in the HTML to get the characters to display properly.
  • Try pasting into a more full-featured text editor like BBEdit instead of TextEdit.

nara.html.zip (5.6 KB)