Window list (WSLIST) sub-connections carry no capability bits, so GetClientEncoding fell back to FindHostByIP(peer IP) to locate the main connection. Under FRP/NAT reverse proxy the sub-connection's socket peer is 127.0.0.1 or an internal relay address, which does not match the main connection's recorded public IP; the lookup returned NULL and the client's UTF-8 window titles were decoded as CP936 (GBK), producing mojibake on hosts with Chinese window titles. Resolve the main connection by clientID first (pinned on the sub-connection after TOKEN_CONN_AUTH via SetID), falling back to the peer-IP lookup only for legacy clients that do not send TOKEN_CONN_AUTH. Co-Authored-By: deepseek-v4-pro
482 KiB
482 KiB