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: [fs] Operate fs failed with non-ASCII file/dir name on WIN. #347

Closed
wants to merge 1 commit into from

Conversation

re2zero
Copy link

@re2zero re2zero commented Oct 24, 2023

On windows platform, if the file/dir name include non-ASCII characters, it can not open this file or read dir. Need to convert the char* to widechar* and then invoke the wide related functions.

Log: fix operate file failed on win.

On windows platform, if the file/dir name include non-ASCII characters, it can not open this file or read dir. Need to convert the char* to widechar* and then invoke the wide related functions.

Log: fix operate file failed on win.
@re2zero
Copy link
Author

re2zero commented Oct 24, 2023

发现在windows上,对含有中文字符的文件或目录进行操作,总是失败,原因是调用的函数 A 只支持ASCII码,改用W 宽字符支持的函数,因此需要转换一下。
目前在Win10上测过,看看有什么更好的建议:)

@idealvin
Copy link
Owner

这是中文编码问题,std::ofstream 也有这个问题吧?

@re2zero
Copy link
Author

re2zero commented Oct 25, 2023

这是中文编码问题,std::ofstream 也有这个问题吧?

std::ofstream 没测试过。是中文编码,转换为UTF-8编码的方法,等空了详细测下。 此PR先挂起吧

idealvin added a commit that referenced this pull request Nov 2, 2023
@idealvin
Copy link
Owner

idealvin commented Nov 2, 2023

这个已经支持了

@idealvin idealvin closed this Nov 4, 2023
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