Skip to content

UnicodeDecodeError when NVDA running on non-English outdated systems #7586

@ghost

Description

When runing the latest NVDA snapshots on Russian versions of outdated Windows (XP/Vista), in the log I have the following exception:
Traceback (most recent call last):
File "nvda.pyw", line 64, in
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128)

Probably, need to explicitly specify the system encoding, since in Russian Windows it is cp1251.
For example, like so:
import winVersion
import locale
if not winVersion.isSupportedOS():
winUser.MessageBox(0, unicode(ctypes.FormatError(winUser.ERROR_OLD_WIN_VERSION), locale.getpreferredencoding()), None, winUser.MB_ICONERROR)
sys.exit(1)
Now the dialogue will be shown correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions