h1aji / chmsee

CHM viewer
GNU General Public License v2.0
1 stars 1 forks source link

chmsee查看文件时乱码 #111

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
首先谢谢你们做出如此优秀的软件。但在使用的时候有点小��
�问题,我使用的是debian系统testing源,chmsee的版本是1.3.0。在�
��开一些文件时,设置了字符集可以把内容变成正常显示,但
目录部分是乱码。如上传的文件所示。

Original issue reported on code.google.com by jeff_j...@126.com on 10 Feb 2011 at 1:19

Attachments:

GoogleCodeExporter commented 8 years ago
我跟踪了一下打开这个文件的过程,发现造成乱码的原因是��
�于该文件提供的语言代码 lcid = 0x0800,而中文应该是 0x0804。

lcid 表可以从这里查到:
http://msdn.microsoft.com/en-us/library/cc233968.aspx

附图是我设置中文为 0x0800 
后的效果,但这只是个临时措施,不符合标准。

Original comment by jungl...@gmail.com on 14 Feb 2011 at 4:38

Attachments:

GoogleCodeExporter commented 8 years ago
谢谢你百忙之中抽出时间来帮忙解决这个问题,你可以我给��
�个patch吗?昨天我试着在models/chmfile.c里增加case 0x0800到return 
"cp936"里,但是没有用,也是乱码。

Original comment by jeff_j...@126.com on 15 Feb 2011 at 12:39

GoogleCodeExporter commented 8 years ago
没错,我也是这样加的:

$ git diff src/models/chmfile.c
diff --git a/src/models/chmfile.c b/src/models/chmfile.c
index c3080b8..3ee20c4 100644
--- a/src/models/chmfile.c
+++ b/src/models/chmfile.c
@@ -471,6 +471,7 @@ get_encoding_by_lcid(guint32 lcid)
                 return "ISO-8859-13";
         case 0x0411:
                 return "cp932";
+        case 0x0800:
         case 0x0804:
         case 0x1004:
                 return "cp936";

但之后要先清一下 .cache/chmsee/bookshelf 里面的目录。

Original comment by jungl...@gmail.com on 15 Feb 2011 at 4:25

GoogleCodeExporter commented 8 years ago
谢谢,当时我没有删除cache。

Original comment by jeff_j...@126.com on 15 Feb 2011 at 11:59

GoogleCodeExporter commented 8 years ago
Clear all pre-2.0 issues

Original comment by jungl...@gmail.com on 18 Jan 2013 at 6:10