summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2013-02-20 18:16:56 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2013-02-20 18:16:56 +0900
commit18415352643a88e4609d466eb0ba00739b3b5f87 (patch)
tree50171693063e5e8840cd89b0736c20fc5ab44df3
parent2690b6ccb27cb14a8878b8ce1bf4540ae6c78b40 (diff)
downloadibus-anthy-18415352643a88e4609d466eb0ba00739b3b5f87.tar.gz
Fixed to convert yen to U+30FC in kana mode. (#1596)
-rw-r--r--engine/kana.py9
-rw-r--r--engine/romaji.py9
-rw-r--r--setup/anthyprefs.py.in7
3 files changed, 11 insertions, 14 deletions
diff --git a/engine/kana.py b/engine/kana.py
index 01da82d..eea2fac 100644
--- a/engine/kana.py
+++ b/engine/kana.py
@@ -105,13 +105,8 @@ class KanaSegment(segment.Segment):
value = None
section = self._kana_typing_rule_section
if section != None:
- try:
- # U+A5 needs to be UTF-8 since gconf values are
- # disk saved values.
- enchars = enchars.encode('utf-8')
- except:
- print >> sys.stderr, \
- 'Failed to encode UTF-8:', enchars
+ # Need to send Unicode to typing_to_config_key instead of UTF-8
+ # not to separate U+A5
gkey = prefs.typing_to_config_key(enchars)
if gkey == '':
return None
diff --git a/engine/romaji.py b/engine/romaji.py
index 2430cce..056c3b2 100644
--- a/engine/romaji.py
+++ b/engine/romaji.py
@@ -58,13 +58,8 @@ class RomajiSegment(segment.Segment):
value = None
section = self._romaji_typing_rule_section
if section != None:
- try:
- # U+A5 needs to be UTF-8 since gconf values are
- # disk saved values.
- enchars = enchars.encode('utf-8')
- except:
- print >> sys.stderr, \
- 'Failed to encode UTF-8:', enchars
+ # Need to send Unicode to typing_to_config_key instead of UTF-8
+ # not to separate U+A5
gkey = prefs.typing_to_config_key(enchars)
if gkey == '':
return None
diff --git a/setup/anthyprefs.py.in b/setup/anthyprefs.py.in
index 7622b75..1de9486 100644
--- a/setup/anthyprefs.py.in
+++ b/setup/anthyprefs.py.in
@@ -102,6 +102,13 @@ class AnthyPrefs(Prefs):
for _key, _ch in _config_key_to_char.items():
self._char_to_config_key[_ch] = _key
for ch in typing:
+ try:
+ # U+A5 needs to be UTF-8 since gconf values are
+ # disk saved values.
+ ch = ch.encode('utf-8')
+ except:
+ print >> sys.stderr, \
+ 'Failed to encode UTF-8:', ch
if ch in _supported_gsettings_key_chars:
if retval != '':
retval += '-'