[CMD][SDK][WINSRV] DIR command: Consider double-width characters (#5442)

The "dir /w" command didn't look good due to unaligned columns.
- Add sdk/include/reactos/cjkcode.h header file.
- Add ConGetTextWidthA/W helper functions.
- Add base/shell/cmd/wcwidth.c to implement ConGetTextWidthW.
- Use ConGetTextWidth in DirPrintWideList function.
- Adjust some STRING_DIR_HELP5, STRING_DIR_HELP6 and STRING_DIR_HELP8 resource strings to make the column aligned.
CORE-17591
This commit is contained in:
Katayama Hirofumi MZ 2023-07-17 07:03:22 +09:00 committed by GitHub
parent 7b473c1fac
commit 726c46d2da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 493 additions and 113 deletions

View file

@ -96,3 +96,12 @@ BOOL ConSetScreenColor(HANDLE hOutput, WORD wColor, BOOL bFill);
// INT FilePromptYN (UINT);
// INT FilePromptYNA (UINT);
SIZE_T ConGetTextWidthA(PCSTR pszText);
SIZE_T ConGetTextWidthW(PCWSTR pszText);
#ifdef UNICODE
#define ConGetTextWidth ConGetTextWidthW
#else
#define ConGetTextWidth ConGetTextWidthA
#endif