Repository: nvaccess/nvda

Issue:
nvda bug in win 10 mail app
seems it only happen with some emails
in the mail app when you are in the mail list and e.g press down arrow
ERROR - eventHandler.executeEvent (16:42:52.007):
error executing event: becomeNavigatorObject on <NVDAObjects.Dynamic_MailItemRowListItemUIA object at 0x014A8DF0> with extra args of {'isFocus': True}
Traceback (most recent call last):
  File "eventHandler.pyc", line 155, in executeEvent
  File "eventHandler.pyc", line 92, in __init__
  File "eventHandler.pyc", line 100, in next
  File "NVDAObjects\__init__.pyc", line 1061, in event_becomeNavigatorObject
  File "braille.pyc", line 1963, in handleReviewMove
  File "braille.pyc", line 1839, in _doNewObject
  File "braille.pyc", line 1520, in getFocusRegions
  File "braille.pyc", line 619, in update
  File "braille.pyc", line 429, in update
  File "louisHelper.pyc", line 65, in translate
  File "louis\__init__.pyc", line 171, in translate
  File "louis\__init__.pyc", line 57, in <lambda>
UnicodeEncodeError: 'utf-32-le' codec can't encode character '\ude6a' in position 111: surrogates not allowed
ERROR - eventHandler.executeEvent (16:48:10.629):
error executing event: becomeNavigatorObject on <NVDAObjects.Dynamic_MailItemRowListItemUIA object at 0x0132D630> with extra args of {'isFocus': True}
Traceback (most recent call last):
  File "eventHandler.pyc", line 155, in executeEvent
  File "eventHandler.pyc", line 92, in __init__
  File "eventHandler.pyc", line 100, in next
  File "NVDAObjects\__init__.pyc", line 1061, in event_becomeNavigatorObject
  File "braille.pyc", line 1963, in handleReviewMove
  File "braille.pyc", line 1839, in _doNewObject
  File "braille.pyc", line 1520, in getFocusRegions
  File "braille.pyc", line 619, in update
  File "braille.pyc", line 429, in update
  File "louisHelper.pyc", line 65, in translate
  File "louis\__init__.pyc", line 171, in translate
  File "louis\__init__.pyc", line 57, in <lambda>
UnicodeEncodeError: 'utf-32-le' codec can't encode character '\ude6a' in position 111: surrogates not allowed

latest nvda dev snapshot of 2019.3


Discussion:
cc: @leonardder, @Andre9642. 
It's likely a quick fix, like an `errors="surrogatepass"` argument to pass.
@leonardder what do you think? Should we modify the Python binding or try to fix on the NVDA side rather?
OK, now I confirm the issue. I'll fill an issue on Liblouis repo and make a PR shortly.
Finally, @leonardder has already fixed this issue in https://github.com/liblouis/liblouis/pull/784.
This will be fixed in Liblouis 3.11 (begin of september)

Resolving patch:
diff --git a/source/brailleTables.py b/source/brailleTables.py
--- a/source/brailleTables.py
+++ b/source/brailleTables.py
@@ -1,8 +1,7 @@
-#brailleTables.py
-#A part of NonVisual Desktop Access (NVDA)
-#This file is covered by the GNU General Public License.
-#See the file COPYING for more details.
-#Copyright (C) 2008-2019 NV Access Limited, Joseph Lee
+# A part of NonVisual Desktop Access (NVDA)
+# This file is covered by the GNU General Public License.
+# See the file COPYING for more details.
+# Copyright (C) 2008-2019 NV Access Limited, Joseph Lee, Babbage B.V.
 
 """Manages information about available braille translation tables.
 """
@@ -69,6 +68,7 @@ def listTables():
 	"en-us-comp8.ctb" : "en-us-comp8-ext.utb",
 	"fr-ca-g1.utb":"fr-bfu-comp6.utb",
 	"Fr-Ca-g2.ctb":"fr-bfu-g2.ctb",
+	"gr-bb.ctb": "grc-international-en.utb",
 	"gr-gr-g1.utb":"el.ctb",
 	"hr.ctb":"hr-comp8.utb",
 	"mn-MN.utb":"mn-MN-g1.utb",
@@ -226,7 +226,7 @@ def listTables():
 addTable("gu-in-g1.utb", _("Gujarati grade 1"))
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
-addTable("gr-bb.ctb", _("Koine Greek"))
+addTable("grc-international-en.utb", _("Greek international braille"))
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
 addTable("he.ctb", _("Hebrew 8 dot computer braille"))


Test patch: