fopen 非 ASCII 字符错误

发布于 2024-07-23 01:29:06 字数 121 浏览 3 评论 0原文

我无法在名称中包含某些字符的文件上使用 fopen(例如:ş、ç、ı) 我如何在这些文件上使用 fopen ? 我正在使用 vc++ 6 (我必须)和 c 语言。 当我尝试使用 _wfopen 时,它永远不会打开任何文件。

i cannot use fopen on files includes in their name some characters (example : ş, ç, ı)
how can i use fopen on these files ?
i'm using vc++ 6 (i have to) and c language.
when i was trying to use _wfopen it's never open any file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

白昼 2024-07-30 01:29:06

将路径名转换为 UTF-16(可能使用 MultiByteToWideChar )并使用 GetShortPathNameW 获取可以传递给 fopen 的路径。

Convert your pathname to UTF-16 (probably using MultiByteToWideChar) and use GetShortPathNameW to get a path you can pass to fopen.

冷心人i 2024-07-30 01:29:06

确保您有 wchar_t (它是编译器设置),并确保您向 _wfopen 传递的是 wchar_t * 而不是 char *。

Make sure that you have wchar_t (it's a compiler setting) and make sure you're passing in a wchar_t * and not a char * to _wfopen.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文