
shenleiandClaude Opus 5
389b643863
docs: 记录 Android GBK 编解码的已知问题(挂起)
用户决定:先保证 macOS 可用,Android 后期再想办法。本次只记录根因,
不动 text_codec.cpp。
症状:build-android.sh 默认 API 24 下 extension/src/net/text_codec.cpp 报
use of undeclared identifier 'iconv_open'。
根因:text_codec.cpp:10 用 __has_include(<iconv.h>) 探测;NDK 里该头在任何
API 等级都存在,但声明被 __BIONIC_AVAILABILITY_GUARD(28) 挡住。用
NDK 28.2 的 clang++ -fsyntax-only 实测:android24 报 3 处 undeclared,
android28 通过。
但升 API 不是解法:NDK iconv.h 写明 bionic 只支持 utf8/ascii/usascii/
utf16{be,le}/utf32{be,le}/wchart,没有 GB2312/GBK。升到 28 后
iconv_open("GB2312","UTF-8") 运行期返回 -1,encode_one()/decode_wire()
对所有输入都返回 false——连纯 ASCII 也被拒,比现有 #else 的 ASCII 回退
分支(text_codec.cpp:104-127)更糟。且 APK min_sdk 要跟着 >=28,
config/android/pyconfig.h 是 API 24 下 configure 的,需返工。
将来的修法写进了 PORT-PLAN 的新小节。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 09:57:27 +09:00
..
2026-09-23 01:41:38 +09:00
2026-09-22 17:51:52 +09:00
2026-09-22 23:59:18 +09:00
2026-09-23 09:16:37 +09:00
2026-09-22 17:51:52 +09:00
2026-09-22 23:21:24 +09:00
2026-09-23 09:57:27 +09:00
2026-09-22 17:51:52 +09:00
2026-09-22 19:21:10 +09:00
2026-09-22 17:17:49 +09:00