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

Set console code page to CP_UTF8 on Windows if supported. #3050

Merged
merged 1 commit into from
Apr 25, 2019

Conversation

phoerious
Copy link
Member

@phoerious phoerious commented Apr 21, 2019

Type of change

  • ✅ Bug fix (non-breaking change which fixes an issue)

Description and Context

Previously, we enforced code page 850 for all console input and output, which breaks with non-western scripts. Since more recent Windows shells are able to display Unicode properly, this patch now enforces UTF-8 and falls back to code page 850 only if UTF-8 is unsupported.

Non-Windows systems default to UTF-8, but can override the codec by setting the LANG environment variable to something other than C.

Resolves #3049.

Testing strategy

CLI tests testing non-ASCII passwords on the command line still pass (they wouldn't with a wrong console CP). Manual tests with Unicode passwords also yield the desired results.

Checklist:

  • ✅ I have read the CONTRIBUTING document. [REQUIRED]
  • ✅ My code follows the code style of this project. [REQUIRED]
  • ✅ All new and existing tests passed. [REQUIRED]
  • ✅ I have compiled and verified my code with -DWITH_ASAN=ON. [REQUIRED]

@phoerious phoerious added this to the v2.4.2 milestone Apr 21, 2019
@phoerious phoerious requested a review from a team April 21, 2019 11:59
@phoerious phoerious force-pushed the hotfix/3049-windows-cmd-encoding branch 3 times, most recently from 2ac986f to 7c3ab23 Compare April 21, 2019 12:11
Previously, we enforced code page 850 for all console input and output,
which breaks with non-western scripts. Since more recent Windows shells
are able to display Unicode properly, this patch now enforces UTF-8 and
falls back to code page 850 only if UTF-8 is unsupported.

Non-Windows systems default to UTF-8, but can override the codec
by setting the LANG environment variable to something other than C.

Resolves #3049.
@phoerious phoerious force-pushed the hotfix/3049-windows-cmd-encoding branch from 7c3ab23 to 3a34fd9 Compare April 21, 2019 12:45
@phoerious phoerious merged commit d3a53a7 into release/2.4.2 Apr 25, 2019
@phoerious phoerious deleted the hotfix/3049-windows-cmd-encoding branch April 25, 2019 07:28
droidmonkey added a commit that referenced this pull request May 31, 2019
- Improve resilience against memory attacks - overwrite memory before free [#3020]
- Prevent infinite save loop when location is unavailable [#3026]
- Attempt to fix quitting application when shutdown or logout issued [#3199]
- Support merging database custom data [#3002]
- Fix opening URL's with non-http schemes [#3153]
- Fix data loss due to not reading all database attachments if duplicates exist [#3180]
- Fix entry context menu disabling when using keyboard navigation [#3199]
- Fix behaviors when canceling an entry edit [#3199]
- Fix processing of tray icon click and doubleclick [#3112]
- Update group in preview widget when focused [#3199]
- Prefer DuckDuckGo service over direct icon download (increases resolution) [#2996]
- Remove apply button in application settings [#3019]
- Use winqtdeploy on Windows to correct deployment issues [#3025]
- Don't mark entry edit as modified when attribute selection changes [#3041]
- Use console code page CP_UTF8 on Windows if supported [#3050]
- Snap: Fix locking database with session lock [#3046]
- Snap: Fix theming across Linux distributions [#3057]
- Snap: Use SNAP_USER_COMMON and SNAP_USER_DATA directories [#3131]
- KeeShare: Automatically enable WITH_XC_KEESHARE_SECURE if quazip is found [#3088]
- macOS: Fix toolbar text when in dark mode [#2998]
- macOS: Lock database on switching user [#3097]
- macOS: Fix global Auto-Type when the database is locked [#3138]
- Browser: Close popups when database is locked [#3093]
- Browser: Add tests [#3016]
- Browser: Don't create default group if custom group is enabled [#3127]
@phoerious phoerious added pr: bugfix Pull request that fixes a bug and removed bug labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n platform: Windows pr: bugfix Pull request that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants