forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scim-pinyin-0.5.91-gbk.patch
62 lines (60 loc) · 2.44 KB
/
scim-pinyin-0.5.91-gbk.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
diff -Nru scim-pinyin-0.5.91.orig/src/scim_pinyin_imengine.cpp scim-pinyin-0.5.91/src/scim_pinyin_imengine.cpp
--- scim-pinyin-0.5.91.orig/src/scim_pinyin_imengine.cpp 2005-08-06 23:31:08.000000000 +0800
+++ scim-pinyin-0.5.91/src/scim_pinyin_imengine.cpp 2009-02-18 00:06:34.000000000 +0800
@@ -706,8 +706,12 @@
m_sys_phrase_lib = m_pinyin_global->get_sys_phrase_lib ();
m_user_phrase_lib = m_pinyin_global->get_user_phrase_lib ();
}
-
- if (encoding == "GBK" || encoding == "GB2312") {
+
+ if (encoding == "GBK") {
+ m_simplified = true;
+ m_traditional = true;
+ m_chinese_iconv.set_encoding ("GBK");
+ } else if (encoding == "GB2312") {
m_simplified = true;
m_traditional = false;
m_chinese_iconv.set_encoding ("GB2312");
@@ -930,10 +934,39 @@
m_iconv.set_encoding (encoding);
- if (encoding == "GBK" || encoding == "GB2312") {
- m_simplified = true;
- m_traditional = false;
- m_chinese_iconv.set_encoding ("GB2312");
+ if (encoding == "GBK") {
+ if (m_simplified == false) {
+ if(m_traditional == true){
+ ; //Big5. Big5togbk is not implemented. Set to next available.
+ m_simplified = true;
+ m_chinese_iconv.set_encoding ("GBK");
+ }else{ // nochinese mode. Should not happen.
+ m_forward = true;
+ m_chinese_iconv.set_encoding ("");
+ }
+ }else{
+ if( m_traditional == false) //GB2312
+ m_chinese_iconv.set_encoding("GB2312");
+ else m_chinese_iconv.set_encoding ("GBK"); //ALL
+ }
+ } else if (encoding == "GB2312") {
+ if ( m_simplified == false ) {
+ if(m_traditional == true) {
+ ; //partly map big5 to gb2312 is not done. Set to next.
+ m_forward = true;
+ m_chinese_iconv.set_encoding ("");
+ }else{//Should not happen.
+ m_forward = true;
+ m_chinese_iconv.set_encoding("");
+ }
+ }else{
+ if (m_traditional == true) { //Should not happen.
+ m_forward = true;
+ m_chinese_iconv.set_encoding ("");
+ }else{
+ m_chinese_iconv.set_encoding ("GB2312");
+ }
+ }
} else if (encoding == "BIG5" || encoding == "BIG5-HKSCS") {
m_simplified = false;
m_traditional = true;