开发者

How would one get a UTF-8/Unicode string from GetOpenFileName?

开发者 https://www.devze.com 2023-03-01 05:20 出处:网络
I\'m developing an application in MinGW/C++ that uses Windows\' common dialogs. The need has arisen to collect a file name that might have non-ASCII characters in it. Is there a flag or another option

I'm developing an application in MinGW/C++ that uses Windows' common dialogs. The need has arisen to collect a file name that might have non-ASCII characters in it. Is there a flag or another option for retrieving a file开发者_运维技巧 name in Unicode, or preferably UTF-8?


Call GetOpenFileNameW. You can do this without converting your entire app to Unicode which may be the most expedient solution.

Windows API comes in 2 flavours, ANSI and Unicode. The former has functions with an A suffix. The latter have a W suffix. You are currently using the former.

0

精彩评论

暂无评论...
验证码 换一张
取 消