setlocale(LC_ALL, "") maps to the ANSI code page on Windows -- 936 (GBK)
on a Chinese system -- so wcrtomb() produces GBK where the protocol wants
UTF-8, and mbrtowc() reads UTF-8 as GBK. Typed Chinese therefore reached
the model as mojibake, and once the buffer held correct UTF-8 the input
line rendered as mojibake instead. Windows' C runtime has no ".UTF-8"
locale to switch to, so the conversion has to be explicit.
os_compat.[ch]
* add os_utf8_encode() and os_utf8_decode(), locale-independent, with
range and overlong-form checks
src/tui.c
* input_put_wc(), the command-palette filter and the ask_user buffer use
os_utf8_encode() instead of wcrtomb()
src/textsel.c
* cst_utf8_decode() uses os_utf8_decode() instead of mbrtowc()
An OpenSSL-based libcurl keeps the CA path it was built with. MSYS2's is
"/mingw64/etc/ssl/certs/ca-bundle.crt", which resolves to nothing once the
binary runs outside an MSYS2 shell, and that build ignores CURL_CA_BUNDLE,
SSL_CERT_FILE and SSL_CERT_DIR. Every HTTPS request then failed with
CURLE_SSL_CACERT_BADFILE (77).
llm_apply_ca_bundle() sets CURLOPT_CAINFO from $CST_CA_BUNDLE, falling back
to ca-bundle.crt beside the executable. If neither exists nothing is set,
so a libcurl linked against Schannel (the Windows certificate store)
behaves exactly as before.
WHC
merged commit 9862c29f58 into main2026-10-06 19:51:28 +08:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
setlocale(LC_ALL, "") maps to the ANSI code page on Windows -- 936 (GBK) on a Chinese system -- so wcrtomb() produces GBK where the protocol wants UTF-8, and mbrtowc() reads UTF-8 as GBK. Typed Chinese therefore reached the model as mojibake, and once the buffer held correct UTF-8 the input line rendered as mojibake instead. Windows' C runtime has no ".UTF-8" locale to switch to, so the conversion has to be explicit. os_compat.[ch] * add os_utf8_encode() and os_utf8_decode(), locale-independent, with range and overlong-form checks src/tui.c * input_put_wc(), the command-palette filter and the ask_user buffer use os_utf8_encode() instead of wcrtomb() src/textsel.c * cst_utf8_decode() uses os_utf8_decode() instead of mbrtowc()可以