Skip to content

Commit

Permalink
ui.browseableMessage: Fix UnicodeEncodeError with Unicode strings.
Browse files Browse the repository at this point in the history
Also, anything presented to the user should be unicode anyway, so change the docstring to require this.
Re #4908. Fixes #5628.
  • Loading branch information
jcsteh committed Dec 22, 2015
1 parent f11f942 commit d2bed22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/ui.py
Expand Up @@ -36,9 +36,9 @@ def browseableMessage(message,title=None , isHtml=False):
"""Present a message to the user that can be read in browse mode.
The message will be presented in an HTML document.
@param message: The message in either html or text.
@type message: str
@type message: unicode
@param title: The title for the message.
@type title: str
@type title: unicode
@param isHtml: Whether the message is html
@type isHtml: boolean
"""
Expand All @@ -51,7 +51,7 @@ def browseableMessage(message,title=None , isHtml=False):
# Translators: The title for the dialog used to present general NVDA messages in browse mode.
title = _("NVDA Message")
isHtmlArgument = "true" if isHtml else "false"
dialogString = "{isHtml};{title};{message}".format( isHtml = isHtmlArgument , title=title , message=message )
dialogString = u"{isHtml};{title};{message}".format( isHtml = isHtmlArgument , title=title , message=message )
dialogArguements = automation.VARIANT( dialogString )
gui.mainFrame.prePopup()
windll.mshtml.ShowHTMLDialogEx( gui.mainFrame.Handle , moniker , HTMLDLG_MODELESS , addressof( dialogArguements ) , unicode(DIALOG_OPTIONS ), None)
Expand Down

0 comments on commit d2bed22

Please sign in to comment.