[orca] Fix for bug 658134 - Lines with unexpected characters are not always displayed in braille by Orca
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Fix for bug 658134 - Lines with unexpected characters are not always displayed in braille by Orca
- Date: Wed, 14 Sep 2011 18:18:50 +0000 (UTC)
commit 2aa1c65ce6a9b9d1b57815a4dd3cdf42db3697ab
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date: Wed Sep 14 14:15:02 2011 -0400
Fix for bug 658134 - Lines with unexpected characters are not always displayed in braille by Orca
src/orca/braille.py | 16 +++++++++++++---
src/orca/brlmon.py | 4 ++--
2 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/src/orca/braille.py b/src/orca/braille.py
index ebb0844..43099f9 100644
--- a/src/orca/braille.py
+++ b/src/orca/braille.py
@@ -354,7 +354,7 @@ class Region:
try:
string = string.decode("UTF-8")
except UnicodeEncodeError:
- debug.printException(debug.LEVEL_SEVERE)
+ debug.printException(debug.LEVEL_FINEST)
# The uncontracted string for the line.
#
@@ -1372,12 +1372,22 @@ def refresh(panToCursor=True,
cursorCell += 1 # Normalize to 1-based offset
logLine = "BRAILLE LINE: '%s'" % string
+ try:
+ logLine = logLine.encode("UTF-8")
+ except UnicodeDecodeError:
+ pass
+
debug.println(debug.LEVEL_INFO, logLine)
- log.info(logLine.encode("UTF-8"))
+ log.info(logLine)
+
logLine = " VISIBLE: '%s', cursor=%d" % \
(string[startPos:endPos], cursorCell)
+ try:
+ logLine = logLine.encode("UTF-8")
+ except UnicodeDecodeError:
+ pass
+
debug.println(debug.LEVEL_INFO, logLine)
- log.info(logLine.encode("UTF-8"))
substring = string[startPos:endPos]
if not _brlAPIRunning:
diff --git a/src/orca/brlmon.py b/src/orca/brlmon.py
index 3a15fae..fc3af51 100644
--- a/src/orca/brlmon.py
+++ b/src/orca/brlmon.py
@@ -216,8 +216,8 @@ class BrlMon(Gtk.Window):
try:
string = string.decode("UTF-8")
- except:
- string = ""
+ except UnicodeEncodeError:
+ pass
length = min(len(string), len(self.cells))
for i in range(length):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]