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

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

Merged
merged 1 commit into from
Dec 10, 2018

Conversation

rdoeffinger
Copy link
Contributor

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

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 IJHack#412
@codecov
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
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants