Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rhdunn opened this issue Jul 16, 2020 · 1 comment
Open

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

rhdunn opened this issue Jul 16, 2020 · 1 comment
Labels
component/speech-synth-drivers good first issue github features these at https://github.com/nvaccess/nvda/contribute maintenance/dependencyUpdate Maintenance of NVDA, specifically dependency updates. p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority quick fix triaged Has been triaged, issue is waiting for implementation.

Comments

@rhdunn
Copy link

rhdunn commented Jul 16, 2020

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

@paulber19
Copy link

It seems that this problem is still not solved although NVDA regularly integrates new versions of ESpeak NG.
It is still not possible to select the synthesizer if the NVDA installation path contains accented characters.It seems that this problem is still not solved although NVDA regularly integrates new versions of ESpeak NG.
It is still not possible to select the synthesizer if the NVDA installation path contains accented characters.

@seanbudd seanbudd added p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. good first issue github features these at https://github.com/nvaccess/nvda/contribute labels Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/speech-synth-drivers good first issue github features these at https://github.com/nvaccess/nvda/contribute maintenance/dependencyUpdate Maintenance of NVDA, specifically dependency updates. p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority quick fix triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

No branches or pull requests

4 participants