[orca] Fix for bug 674237 - More unicode errors found with hungarian locale
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Fix for bug 674237 - More unicode errors found with hungarian locale
- Date: Mon, 30 Apr 2012 14:00:51 +0000 (UTC)
commit a448fa054f2f13488a8f4e497a6efaeb62385790
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Mon Apr 30 10:00:02 2012 -0400
Fix for bug 674237 - More unicode errors found with hungarian locale
src/orca/keynames.py | 6 +++++-
src/orca/script_utilities.py | 9 ++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/keynames.py b/src/orca/keynames.py
index 1336da2..2c7c0b4 100644
--- a/src/orca/keynames.py
+++ b/src/orca/keynames.py
@@ -330,8 +330,12 @@ def localizeKeySequence(keys):
for key in keyList:
keyName = getKeyName(key)
try:
+ key = key.decode("UTF-8")
+ except UnicodeEncodeError:
+ pass
+ try:
keyName = keyName.decode("UTF-8")
- except (UnicodeDecodeError, UnicodeEncodeError):
+ except UnicodeEncodeError:
pass
keys = keys.replace(key, keyName)
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 1c9dd90..6a6421a 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -2662,6 +2662,10 @@ class Utilities:
# 'superscript 3' should be presented as 'X superscript 23'.
#
newString = _(" superscript %s") % "".join(new)
+ try:
+ newString = newString.decode("UTF-8")
+ except UnicodeEncodeError:
+ pass
uString = re.sub(number, newString, uString)
for number in subscripted:
@@ -2673,7 +2677,10 @@ class Utilities:
#
newString = _(" subscript %s") % "".join(new)
uString = re.sub(number, newString, uString)
-
+ try:
+ newString = newString.decode("UTF-8")
+ except UnicodeEncodeError:
+ pass
try:
uString = uString.encode("UTF-8")
except UnicodeDecodeError:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]