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

Fix character encoding issues for non-UTF-8 locales. #435

Merged
merged 1 commit into from Dec 10, 2018

Conversation

Projects
None yet
3 participants
@rdoeffinger
Copy link
Contributor

rdoeffinger commented Nov 17, 2018

Since we (most sensibly) encode text as UTF-8 before
encrypting we should assume that the password files
contain UTF-8 when decrypting, instead of the current
locale encoding.
This is the biggest issue on Windows, since it doesn't
even officially support locales with UTF-8 encoding.
For compatibility, detect if the data is not valid UTF-8
and fall back to Qt's BOM based approach, which provides
support for UTF-16 and falls back to current locale encoding.

Fixes issue #412

Fix character encoding issues for non-UTF-8 locales.
Since we (most sensibly) encode text as UTF-8 before
encrypting we should assume that the password files
contain UTF-8 when decrypting, instead of the current
locale encoding.
This is the biggest issue on Windows, since it doesn't
even officially support locales with UTF-8 encoding.
For compatibility, detect if the data is not valid UTF-8
and fall back to Qt's BOM based approach, which provides
support for UTF-16 and falls back to current locale encoding.

Fixes issue #412
@codecov

This comment has been minimized.

Copy link

codecov bot commented Nov 17, 2018

Codecov Report

Merging #435 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #435      +/-   ##
=========================================
- Coverage    7.25%   7.23%   -0.02%     
=========================================
  Files          41      41              
  Lines        2662    2666       +4     
=========================================
  Hits          193     193              
- Misses       2469    2473       +4
Impacted Files Coverage Δ
src/executor.cpp 4.41% <0%> (-0.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e77509...11a04a2. Read the comment docs.

@coveralls

This comment has been minimized.

Copy link

coveralls commented Nov 17, 2018

Coverage Status

Coverage decreased (-0.007%) to 7.254% when pulling 11a04a2 on rdoeffinger:encodingfix into 8e77509 on IJHack:master.

@annejan annejan merged commit fa747ad into IJHack:master Dec 10, 2018

3 of 5 checks passed

codecov/patch 0% of diff hit (target 7.25%)
Details
codecov/project 7.23% (-0.02%) compared to 8e77509
Details
CodeFactor No issues found.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment