[orca] Fix for bug 659122 - Orca 3.1.91 and master version producing unicode decode error traceback with sp



commit a7e1f5379e1cac23b448aaa855a3df43d493b6cd
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Thu Sep 15 07:17:56 2011 -0400

    Fix for bug 659122 - Orca 3.1.91 and master version producing unicode decode error traceback with speech generation if I using hungarian locale

 src/orca/speech.py                  |    6 ++++++
 src/orca/speechdispatcherfactory.py |    5 +++++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/speech.py b/src/orca/speech.py
index eccea41..f6c7841 100644
--- a/src/orca/speech.py
+++ b/src/orca/speech.py
@@ -178,6 +178,12 @@ def _speak(text, acss, interrupt):
                 if key != settings.DEFAULT_VOICE:
                     extraDebug = " voice=%s" % key
                 break
+
+    try:
+        extraDebug = extraDebug.encode("UTF-8")
+    except UnicodeDecodeError:
+        pass
+
     debug.println(debug.LEVEL_INFO, logLine + extraDebug)
     log.info(logLine + extraDebug)
 
diff --git a/src/orca/speechdispatcherfactory.py b/src/orca/speechdispatcherfactory.py
index ae3fd83..3fef20c 100644
--- a/src/orca/speechdispatcherfactory.py
+++ b/src/orca/speechdispatcherfactory.py
@@ -177,6 +177,11 @@ class SpeechServer(speechserver.SpeechServer):
         # the list will contain the names of all available "real"
         # voices provided by the speech engine.
         #
+        try:
+            serverId = serverId.encode("UTF-8")
+        except UnicodeDecodeError:
+            pass
+
         self._default_voice_name = _("%s default voice") % serverId
         
         try:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]