Set xgettext encoding to UTF-8 (#11080)#11081
Conversation
feerrenrut
left a comment
There was a problem hiding this comment.
Thanks @JulienCochuyt
Does this mean we have no use for the utf-8 encoding headers now? Should they be removed from the developer guide?
|
@feerrenrut wrote:
Considering Python 3 source files are expected to be encoded in UTF-8, encoding declaration in the header of files containing non-ASCII characters is, as of this PR, technically superfluous. On the other hand, it could be considered as a reminder to individual contributors to check the settings of their editor of choice before messing up with the source file. It also instruct many editors to automatically apply the proper encoding. Given this, I guess instructing to add it or not is by now just a matter of style. |
Follow up #11081 Set Flake8 encoding to UTF-8
Since nvaccess/nvda#11081 it is expected that xgettext should be run by manually specifying the file encoding.
Link to issue number:
Fixes #11080
Summary of the issue:
Current xgettext integration does not allow to follow copyright headers guidelines as xgettext complains about non-ASCII characters found in author names.
Description of how this pull request fixes the issue:
Setting UTF-8 as the source files encoding upon invoking xgettext from Scons.
Testing performed:
Building POT.
Known issues with pull request:
The proposed change automatically considers all source files as encoded in UTF-8, which is the standard in Python 3.
If we still were using Python 2, I would have instead advocated for the use of an encoding declaration header line in each incriminated source file, such as:
Change log entry:
I do not think this deserves a change log entry.