「感恩samwhelp詳解 讚嘆samwhelp」童貞在日本 gcin 掛了! 跪求解 已爬文5天 [論壇 - 新手村]
正在瀏覽:
1 名遊客
「感恩samwhelp詳解 讚嘆samwhelp」童貞在日本 gcin 掛了! 跪求解 已爬文5天 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員一級
![]() ![]() 註冊日期:
2012/9/18 15:21 所屬群組:
已註冊使用者 等級: 2
HP : 0 / 43
![]() |
前輩先進您好
xubuntu 更新後 gcin就開始異常 常常無故crash 跪請版上前輩先進指點 也依#部份應用軟體無法輸入中文 S大解說step by step 無解也不知為何? 也參考#裝了64位元版 一直無法輸入中文 ubuntu 16.04 lts Xfce 4.12 ~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial ~$ apt-cache showpkg gcin 反正一串 ver 2.8.4+dfsg1-1ubuntu1.1 ..... fcitx更是一大串 ver 1:4.2.9-lubuntu1.16 ..... +++-==============-============-============-================================= ii gcin 2.8.4+dfsg1- i386 GTK+ based input method for Chine ii gcin-anthy 2.8.4+dfsg1- i386 support library to use Anthy in g ii gcin-data 2.8.4+dfsg1- all icons and scripts for gcin ii gcin-gtk2-immo 2.8.4+dfsg1- i386 GTK2 input method module with gci ii gcin-gtk3-immo 2.8.4+dfsg1- i386 GTK3 input method module with gci ii gcin-qt4-immod 2.8.4+dfsg1- i386 Qt4 input method module with gcin ii gcin-qt5-immod 2.8.4+dfsg1- i386 Qt5 input method module with gcin ii gcin-tables 2.8.4+dfsg1- i386 input method tables for gcin un gcin-voice <無> <none> (無相關介紹) ii libgcin:i386 2.8.4+dfsg1- i386 library for gcin ========================================================= gcin install gcin-anthy install gcin-data install gcin-gtk2-immodule:i386 install gcin-gtk3-immodule:i386 install gcin-qt4-immodule:i386 install gcin-qt5-immodule:i386 install gcin-tables install libgcin:i386 install ============================================================ 附圖先 https://imgur.com/a/6x01b https://imgur.com/a/oBMU6 https://imgur.com/a/1q6U4 解除安裝後再次重新安裝依然無解 https://imgur.com/a/5Pe5U 改用fcitx 也無法使用酷音輸入 https://imgur.com/a/D5LjH https://imgur.com/a/N3zmG https://imgur.com/a/TgGjn hotkey也無法成功切換 只能輸入En https://imgur.com/a/ltXMB https://imgur.com/a/pjoV9 櫻花妹已經等到不耐煩了~櫻花妹已經等到不耐煩了~櫻花妹已經等到不耐煩了~ 跪求前輩先進們解惑 locale -a C C.UTF-8 en_AG en_AG.utf8 en_AU.utf8 en_BW.utf8 en_CA.utf8 en_DK.utf8 en_GB.utf8 en_HK.utf8 en_IE.utf8 en_IN en_IN.utf8 en_NG en_NG.utf8 en_NZ.utf8 en_PH.utf8 en_SG.utf8 en_US.utf8 en_ZA.utf8 en_ZM en_ZM.utf8 en_ZW.utf8 POSIX zh_HK.utf8 zh_TW.utf8
2017/11/20 14:05
|
||||||||||
![]() |
回覆: 童貞在日本 gcin 掛了! 跪求解 已爬文5天 (包含samwhelp詳解) |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
管理員
![]() ![]() 註冊日期:
2012/1/14 18:41 所屬群組:
討論區管理群 等級: 20
HP : 0 / 480
![]() |
看起來應該是沒有中文語系的支援,我不知道他的系統怎麼用
我在此提供我ubuntu的 用root執行以下的指令 echo "zh_TW.UTF-8 UTF-8" > /var/lib/locales/supported.d/zh-hant echo "zh_HK.UTF-8 UTF-8" > /var/lib/locales/supported.d/zh-hant locale-gen sudo apt install fonts-wqy-microhei 可以嘗試看看 不過他錯誤的目標路徑,我這邊沒有任何檔案。不知道是不是包裝差別。
2017/11/20 15:51
|
||||||||||
![]() |
回覆: 童貞在日本 gcin 掛了! 跪求解 已爬文5天 (包含samwhelp詳解) |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 179 / 898
![]() |
剛剛做了一點測試,先簡略報告一下
您可以先把「~/.gcin」這個資料夾刪除,這樣「gcin」,就暫時可以恢復正常。 然而我測試,要讓「gcin」變成您提到的狀況,只要點選「切換到舊的注音鍵盤」,就會出現您說的狀況。 我初步的觀察,只要點選「切換到舊的注音鍵盤」, 就會產生「~/.gcin/config/phonetic-keyboard2」和「~/.gcin/config/phonetic-keyboard-bak」這兩個檔案。 這兩個檔案都是空白的,然後就會出現您說的狀況。 所以其實應該只要刪除這兩個檔案,應該就會暫時恢復正常。 或是也可以將這兩個檔案手動填入「zo 123456789 1 0」,應該也是可以正常運作,請見下面「後記」的分析。
================================================================================ 然後我執行「apt-get source gcin」下載程式碼來觀看。 初步找到的相關的程式碼, 在「tray-win32.cpp」的「void fast_phonetic_kbd_switch()」 和「gcin-settings.cpp」的 「void load_setttings()」 和「pho.cpp」的「void load_tab_pho_file()」(您提供的「圖一」,「圖二」,「圖三」) 和「gcin-setup-pho.cpp」的「static int get_current_kbm_idx()」(您提供的圖) 第一次出錯會顯示
第二次以後出錯會顯示
註: * 上面「/home/user/app/gcin/」,是因為我測試的時候,安裝在「/home/user/app/gcin/」這個資料夾。 在編譯前,是先執行「./configure --prefix=/home/user/app/gcin」。 * 要編譯的前置作業,則是執行「$ sudo apt-get install build-essential 」和執行「$ sudo apt-get build-dep gcin」。 ================================================================================ 我對「gcin」的原始碼並不熟,所以不曉得出錯的源頭會是在那。 所以暫時先測試到這裡,紀錄相關的線索,提供參考。 我也有回覆您在gcin原作者的論壇的「討論串」了。 ================================================================================ 後記: 在「gcin-conf.h」,有一行「#define PHONETIC_KEYBOARD "phonetic-keyboard2"」。 後來發現「gcin-conf.cpp」這個檔案 裡面的「void get_gcin_conf_str(char *name, char **rstr, char *default_str)」, 並不能處理「檔案內容」是「空白」或是「多個空白」的情形, 因為「default_str」只有在「檔案不存在時」,才會設給「rstr」。 所以在「gcin-settings.cpp」裡面的「void load_setttings()」, 有一行「get_gcin_conf_fstr(PHONETIC_KEYBOARD, phokbm, kbm_str);」, 而「get_gcin_conf_fstr」會再呼叫「get_gcin_conf_str」, 也就是當呼叫「get_gcin_conf_fstr」後, 而「~/.gcin/config/phonetic-keyboard2」這個檔案是存在的, 但內容是「空白」,而不是預期的「zo 123456789 1 0」這樣的格式, 因此「phokbm」並不會如預期的,得到「kbm_str」這個預設值。 關於「kbm_str」的值,可能是「pinyin 123456789 1 1」或是「zo 123456789 1 1」, 請見「char *kbm_str = is_chs?"pinyin "N1234" 1 1":"zo "N1234" 1 1";」。 也就是「phokbm」還是得到「~/.gcin/config/phonetic-keyboard2」這個檔案的內容, 也就是「phokbm」是「空白」或是「多個空白」的情形。 後面「phokbm」透過「sscanf」拆解後, 對於「phokbm_name」和「selkey」也沒有再額外處理這部份的例外,或是限制允許的值, 所以就導致錯誤情形發生了。 猜測「hime」也有可能會有同樣的情形, 實際上還是要探索「hime-conf.c」和「hime-settings.c」以及「tray-double.c」的實作,才能曉得, 另外發現「hime」除了原本的「~/.config/hime/config」這個資料夾, 一些設定是先從「~/.config/hime/hime.conf」來讀取,「hime.conf」是「ini檔」。 執行「$ grep 'phonetic-keyboard' ~/.config/hime/hime.conf」就可以找到。 後來又找到了相關的「Manpage」 $ man gcin-tools $ man hime-setup ================================================================================ 如何下載「gcin」的原始碼 * $ apt-get source gcin * https://hyperrate.com/gcin-source/ ================================================================================ ## main.c 下面這段,從「gcin-settings.cpp」裡面的「void load_setttings()」改寫的。 #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_GCIN_STR (256) char *pho_kbm_name, *pho_selkey; int main () { //char phokbm[MAX_GCIN_STR] = "zo 123456789 1 0"; // 預期的值 char phokbm[MAX_GCIN_STR] = " "; // 出錯的情形 int pho_candicate_col_N, pho_candicate_R2L; char phokbm_name[32], selkey[32]; pho_candicate_col_N=0; pho_candicate_R2L=0; sscanf(phokbm, "%s %s %d %d",phokbm_name, selkey, &pho_candicate_col_N, &pho_candicate_R2L); printf("phokbm_name: %s\n", phokbm_name); printf("selkey: %s\n", selkey); if (pho_candicate_col_N <= 0) pho_candicate_col_N = 1; if (pho_candicate_col_N > strlen(selkey)) pho_candicate_col_N =strlen(selkey); if (pho_candicate_R2L<0 || pho_candicate_R2L>1) pho_candicate_R2L = 0; if (pho_selkey) free(pho_selkey); pho_selkey = strdup(selkey); if (pho_kbm_name) free(pho_kbm_name); pho_kbm_name = strdup(phokbm_name); printf("pho_kbm_name: %s\n", pho_kbm_name); printf("pho_selkey: %s\n", pho_selkey); return 0; } ## build.sh 執行下面指令編譯
## 測試 執行
正常的情形是顯示
所以對照一開始提到的,會是「/usr/share/gcin/table/zo.kbm」 錯誤的狀況則是顯示如下
所以對照一開始提到的,會是「/usr/share/gcin/table/.kbm」 ================================================================================ 以上提供參考 報告完畢 ![]()
2017/11/21 14:26
|
||||||||||
![]() |
回覆: 童貞在日本 gcin 掛了! 跪求解 已爬文5天 (包含samwhelp詳解) |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 179 / 898
![]() |
若您要使用「fcitx-chewing」,安裝的參考操作步驟如下
================================================================================ 執行下面指令,安裝「fcitx-chewing」。
================================================================================ 接著執行下面指令,將系統的輸入法框架,設定為「fcitx」。
註: 上面這個動作做完後,請登出系統,再登入系統,才會生效。 ================================================================================ 登入系統後,您額外還要先作一個設定, 你可以參考「這篇」,來設定「fcitx」,加入可以切換選用的輸入法 將「新酷音」加入,這樣您才能切換「fcitx-chewing (新酷音輸入法」。 以上就是我在通常的狀況下,安裝和設定的所有步驟。 ================================================================================ 題外話,當您執行「im-config -n fcitx」,會產生「~/.xinputrc」這個檔案 執行下面指令「~/.xinputrc」這個檔案
顯示 # im-config(8) generated on Tue, 21 Nov 2017 14:35:17 +0800 run_im fcitx # im-config signature: b9eab1e3a1b9f9e65fb7d6f9c6c3b89f - 主要是「run_im fcitx」這一行。 所以您也可以自己手動產生「~/.xinputrc」這個檔案,然後填入「run_im fcitx」這一行。 這樣的作法一樣是有效的,「fcitx」還是會正常啟動。 只有再次執行「im-config」,才會有問題,但這樣的作法,並不影響「fcitx」的正常啟動。 ================================================================================ 其餘的就是您說的,參考我之前寫的回覆 * #17 回覆: 裝了 ubuntu 16.04 lts 64位元版 一直無法輸入中文 * #5 回覆: 部份應用軟體無法輸入中文 ================================================================================ 以上提供參考, 報告完畢 ![]()
2017/11/21 14:57
|
||||||||||
![]() |
您可以查看帖子.
您不可發帖.
您不可回覆.
您不可編輯自己的帖子.
您不可刪除自己的帖子.
您不可發起投票調查.
您不可在投票調查中投票.
您不可上傳附件.
您不可不經審核直接發帖.