pub fn read_text(path: &str) -> Result<String>Expand description
编码健壮读取:UTF-8(含 BOM)→ UTF-16(BOM)→ UTF-8 lossy。
与 Python 参考实现(utf-8-sig → gbk → latin-1)的差异:Rust 核心不引入
encoding_rs(保持零第三方依赖),GBK 等单/多字节中文编码会退化为替换字符。
中文内容请以 UTF-8 保存;需要 GBK 时由调用方先行转码。