Skip to content

修复 defaultLargeFileHandler 在Windows环境不支持中文#720

Merged
ithewei merged 1 commit intoithewei:masterfrom
House-Men:patch-5
Apr 17, 2025
Merged

修复 defaultLargeFileHandler 在Windows环境不支持中文#720
ithewei merged 1 commit intoithewei:masterfrom
House-Men:patch-5

Conversation

@House-Men
Copy link
Copy Markdown
Contributor

在 hstring.h 中添加 hv::utf8_to_ansi 和 hv::ansi_to_utf8 函数

因为这个内部的大文件处理是采用的HFile封装的标准库ANSI函数处理,而通常只有Windows环境的ANSI不是UTF8编码,所以为了改动幅度最小化并且避免引入iconv外部第三方编码转换库只好借助内置的窄宽字符转换先将浏览器请求的UTF8字符串转换到宽字符,在从宽字符转换到对应本地化编码的ANSI,虽然存在两次转换但大文件传输并不高频触发且系统内置编码转换效率极高影响不大,也为了方便后续Windows环境有这方面转换需要都整合到hstring.h中了。

add hv::utf8_to_ansi and hv::ansi_to_utf8 function to hstring.h
Comment thread cpputil/hstring.h
@ithewei ithewei merged commit ba162bd into ithewei:master Apr 17, 2025
6 checks passed
@House-Men House-Men deleted the patch-5 branch April 17, 2025 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants