Skip to content

The espeak-ng path should be UTF-8 encoded for Unicode paths. #11392

@rhdunn

Description

@rhdunn

The path passed to espeak/espeak-ng in the initialization function should be UTF-8 encoded. This relates to the Unicode path part of #10607.

Specifically, espeak and espeak-ng use the Microsoft CRT stat implementation in the GetFileLength function (used to check if the path exists and is a directory). The documentation for stat [1] states:

The _stat function obtains information about the file or directory specified by path and stores it in the structure pointed to by buffer. _stat automatically handles multibyte-character string arguments as appropriate, recognizing multibyte-character sequences according to the multibyte code page currently in use.

In the initialization of the library version of espeak and espeak-ng, it is using setlocale with the following LC_CTYPE values -- "C.UTF-8", "UTF-8", "en_US.UTF-8", and "". As such, the stat call will be expecting the path string to be a UTF-8 string; if it is not, then the initialization call will fail.

This logic has not changed between espeak and espeak-ng.

[1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions?view=vs-2019

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/speech-synth-driversgood first issuegithub features these at https://github.com/nvaccess/nvda/contributemaintenance/dependencyUpdateMaintenance of NVDA, specifically dependency updates.p3https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priorityquick fixtriagedHas been triaged, issue is waiting for implementation.

    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