Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ibex-windows cmd not support i18n charset #1029

Merged
merged 2 commits into from
Aug 17, 2024

Conversation

zzmark
Copy link
Contributor

@zzmark zzmark commented Aug 12, 2024

Windows cmd 需要使用 ANSI 编码 + CRLF 换行的脚本。

  • 使用 Windows API 转换 ANSI,而不是 golang.org/x/text/encoding 转换,确保最大兼容性,结果一定与机器匹配。

fix #1018

- using native function, support ANSI CodePage from system

fix flashcatcloud#1018
@kongfei605
Copy link
Collaborator

这个再windows下测试过么?

@zzmark
Copy link
Contributor Author

zzmark commented Aug 13, 2024

image
windows 中国语言 有测试。其它语种手头没有环境,只是理论OK

@kongfei605
Copy link
Collaborator

kongfei605 commented Aug 15, 2024

感谢 @zzmark
我比较担心load dll的通用性,就像linux下cgo的版本

@zzmark
Copy link
Contributor Author

zzmark commented Aug 15, 2024

感谢 @zzmark 我比较担心load dll的通用性,就像linux下cgo的版本

windows 系统标准公开api稳定性极好,跨版本没有问题

这次使用的 kernel32 API是核心组件,WideCharToMultiByte 最低要求 windows 2000,基本上支持所有还能正常跑的机器

需要担心的是其它语种,ANSI 规范我只看过点皮毛,对于阿拉伯语系的处理完全不了解,不知道能否引入奇葩符号导致脚本注释失效

@kongfei605 kongfei605 merged commit 5402d79 into flashcatcloud:main Aug 17, 2024
3 checks passed
@kongfei605
Copy link
Collaborator

感谢 @zzmark

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.

categraf在windows执行脚本,当meta/{id}/stdout文件 有中文的时候,会报错
2 participants