mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 20:14:16 +08:00
国内行情软件(同花顺/东财/通达信)及 Windows 中文 Excel 导出的 CSV 多为 GBK 系编码,而 Polars read_csv 默认按 UTF-8 解析,遇中文即抛 'invalid utf-8 sequence'。 新增 ensure_utf8_csv():先尝试 UTF-8(合法则原样返回,零副作用), 否则依次尝试 gb18030/gbk/gb2312/big5 转成 UTF-8 临时文件再交给 Polars。 覆盖上传(upload_data)与字段探测(detect_fields、parse_upload_file)三处入口, 无需新增依赖(编码均为 Python 标准库内置)。