aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2023-06-28 15:10:49 +0100
committerRon Yorston <rmy@pobox.com>2023-06-28 15:10:49 +0100
commitebe80f3e5c9b612f4d1b6e444c9badc10f9f2745 (patch)
treea3d46a237dfbd0c815469b52484431e35a9a237b /docs
parent2984235570c2374adb9ee3234a61f193ee86d654 (diff)
downloadbusybox-w32-ebe80f3e5c9b612f4d1b6e444c9badc10f9f2745.tar.gz
busybox-w32-ebe80f3e5c9b612f4d1b6e444c9badc10f9f2745.tar.bz2
busybox-w32-ebe80f3e5c9b612f4d1b6e444c9badc10f9f2745.zip
win32: don't assume console CP equals OEM CP
Previously, console input was converted to the ANSI codepage using OemToChar[Buff], and ANSI to console conversion used CharToOem[Buff]. However, while typically true by default, it's not guaranteed that the console CP is the same as the OEM CP. Now the code uses the console input/output CP as appropriate instead of the OEM CP. It uses full wide-char conversion code, which was previously limited to FEATURE_EURO, and now may be used also otherwise. While at it, the code now bypasses the conversion altogether if the src/dst CPs happen to be identical - which can definitely happen. Other than saving some CPU cycles, this also happens to fix an issue with the UTF8 manifest (in both input and output), because apparently the Oem/Char conversion APIs fail to convert one char at a time (which is not a complete UTF8 codepoint sequence) even if both the OEM and the ANSI CPs are UTF8 (as is the case when using UTF8 manifest). Conversion is also skipped: - if the converted output would be longer than the input; - if the input length is 1 and the input is multi-byte.
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions