IJHack / QtPass

QtPass is a multi-platform GUI for pass, the standard unix password manager.
https://qtpass.org/
GNU General Public License v3.0
1.03k stars 162 forks source link

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

Closed rdoeffinger closed 5 years ago

rdoeffinger commented 6 years ago

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[bot] commented 6 years ago

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%) :arrow_down:

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 commented 6 years ago

Coverage Status

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