Files
SimpleRemoter/server/2015Remote
yuanyuanxiang 8c0351b45b fix(server): show UTF-8 process names correctly in the connections dialog
The connections dialog decoded procName with CA2T(x, CP_UTF8). In this MBCS
build CA2T expands to CA2A, whose nCodePage argument ATL explicitly ignores
(atlconv.h: "(void)nCodePage") - the call just memcpy's the bytes. So the
UTF-8 process names sent by the client were copied verbatim into a CString and
rendered as GBK: Chinese names turned into mojibake while pure-ASCII names
looked fine, since UTF-8 and GBK coincide there.

Display via the established pattern instead (same as the client list and the
process manager): convert UTF-8 to UTF-16 with MultiByteToWideChar and write
the item text with LVM_SETITEMTEXTW, bypassing the ANSI code page entirely.
This also keeps Chinese names readable on servers running a non-Chinese ACP.

The sort key keeps the raw UTF-8 bytes: byte-wise comparison of UTF-8 equals
code-point order, and no characters can be lost in conversion.
2026-11-02 19:39:17 +01:00
..