ibus有個問題,當它從環境變數判斷中文模式時,
如果沒有正確的值,會使用預設值,而預設值是簡體中文 (棍)
比方你想使用英文桌面搭配中文輸入法時就會遇到這個問題,
或是你的環境變數沒設好,也會遇到打不出倉頡的字或變亂碼
定義及要修改的地方在這裡
/usr/share/ibus-table/engine/table.py
裡面有註解, 0是簡中, 1是繁中,
# self._chinese_mode: the candidate filter mode,
# 0 is simplify Chinese
# 1 is traditional Chinese
# 2 is Big charset mode, but simplify Chinese first
# 3 is Big charset mode, but traditional Chinese first
# 4 is Big charset mode.
# we use LC_CTYPE or LANG to determine which one to use
line 124: 可以搜尋if IME declare as Chinese IME找到那段code
if self.db._is_chinese:
# if IME declare as Chinese IME
return 1
else:
return -1
把原本的0改成1, 再把 ibus-daemon kill重啟 就OK囉~
# sudo pkill ibus-daemon && ibus-daemon -d
Ref: 改變ibus倉頡五代預設語系 (簡->繁)
2012年8月23日 星期四
2012年4月24日 星期二
MySQL 設定為 utf8
設定 /etc/mysql/my.cnf
1。 在[client]區加入
default-character-set = utf8
2. 在 [mysqld]
character_set_server=utf8
collation_server=utf8_unicode_ci
1。 在[client]區加入
default-character-set = utf8
2. 在 [mysqld]
character_set_server=utf8
collation_server=utf8_unicode_ci
3.存檔後重啟mysql
sudo service mysql restart
4. 檢查mysql是否變更為utf8
mysql -uroot -p
輸入mysql root密碼後登入mysql
mysql>
mysql> SHOW VARIABLES LIKE 'character_set_%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
mysql> SHOW VARIABLES LIKE 'collation_%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_unicode_ci |
| collation_server | utf8_unicode_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)
變更成功
Ref:
訂閱:
文章 (Atom)