mate-desktop / pluma

A powerful text editor for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
158 stars 66 forks source link

add gbk encoding to fix open no utf8 Simplified Chinese #522

Closed Doorer closed 4 years ago

Doorer commented 4 years ago

Signed-off-by: zhangjialing zhangjialing@loongson.cn

sc0w commented 4 years ago

@Doorer can you attach a sample file to see the differences opening the file without / with this PR?

yetist commented 4 years ago

Here is a test file with the content “中文测试文本”: gbk.txt

Run pluma with PLUMA_DEBUG=all pluma gbk.txt, we can get the output like this:

[0.171211 (0.000043)] pluma-prefs-manager.c:712 (pluma_prefs_manager_get_auto_detected_encodings) Done
[0.171258 (0.000047)] pluma-smart-charset-converter.c:97 (pluma_smart_charset_converter_init) initializing smart charset converter
[0.171337 (0.000079)] pluma-smart-charset-converter.c:235 (guess_encoding) trying charset: GBK
[0.171785 (0.000448)] pluma-gio-document-loader.c:335 (async_read_cb)
[0.171793 (0.000008)] pluma-gio-document-loader.c:339 (async_read_cb)