[orca] Handle TEXT_BOUNDARY_CHAR returning only part of a multibyte char



commit ed73f6875e2b3fb3ed2662e062302d59f26a9e12
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Apr 18 12:27:25 2019 -0400

    Handle TEXT_BOUNDARY_CHAR returning only part of a multibyte char

 src/orca/scripts/web/script_utilities.py | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 5affaca3e..750e4cf2b 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -1128,6 +1128,14 @@ class Utilities(script_utilities.Utilities):
                   % (offset, obj, boundary, s1, start, end)
             debug.println(debug.LEVEL_INFO, msg, True)
             needSadHack = True
+        elif boundary == pyatspi.TEXT_BOUNDARY_CHAR and string == "\ufffd":
+            msg = "FAIL: Bad results for text at offset %i for %s using %s:\n" \
+                  "      String: '%s', Start: %i, End: %i.\n" \
+                  "      The bug is that we didn't seem to get a valid character.\n" \
+                  "      This very likely needs to be fixed by the toolkit." \
+                  % (offset, obj, boundary, string, start, end)
+            debug.println(debug.LEVEL_INFO, msg, True)
+            needSadHack = True
 
         if needSadHack:
             sadString, sadStart, sadEnd = self.__findRange(text, offset, start, end, boundary)


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