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

Update gcov.py #334

Merged
merged 1 commit into from Nov 2, 2019
Merged

Update gcov.py #334

merged 1 commit into from Nov 2, 2019

Conversation

alex43dm
Copy link
Contributor

@alex43dm alex43dm commented Sep 26, 2019

UnicodeDecodeError: 'utf-8' codec can't decode byte

UnicodeDecodeError: 'utf-8' codec can't decode byte
@latk
Copy link
Member

latk commented Nov 2, 2019

Thank you for this pull request! I was not sure why this change was necessary, but it seems that gcov uses the GNU gettext translation software, which has a complex interaction with environment variables:

GNU gettext gives preference to LANGUAGE over LC_ALL and LANG for the purpose of message handling, but you still need to have LANG (or LC_ALL) set to the primary language; this is required by other parts of the system libraries.

https://www.gnu.org/software/gettext/manual/gettext.html#The-LANGUAGE-variable

So if a user has LANGUAGE set, overriding LC_ALL is not enough – we need to override both variables.

Thanks to this change, the language override should be correct. However, I'm not yet sure whether this also forces UTF-8 encoding, so future bugs are still possible.

latk
latk approved these changes Nov 2, 2019
latk added a commit that referenced this issue Nov 2, 2019
It seems that gcov uses the GNU gettext translation software, which has
a complex interaction with environment variables:

>  GNU gettext gives preference to LANGUAGE over LC_ALL and LANG for
>  the purpose of message handling, but you still need to have LANG (or
>  LC_ALL) set to the primary language; this is required by
>  other parts of the system libraries.
>
>  — https://www.gnu.org/software/gettext/manual/gettext.html#The-LANGUAGE-variable

So if a user has LANGUAGE set, overriding LC_ALL is not enough – we need
to override both variables.
@latk latk merged commit 174a80b into gcovr:master Nov 2, 2019
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants