开发者

C++/QT - QFileDialog::getOpenFileName filter *.xml disables files with japanese characters in their name

I'm trying to use a QFileDialog::getOpenFileName with an xml filter defined tr("XML Files (*.xml)") to ask the user to select an XML file.

However, in case there's a file in the directory that has japanese characters in its name ( e.g: ラドクリフ.xml ), the file is shown to be disabled, so the user can开发者_Go百科't select it. Other files, such as a.xml, b.xml are shown to be select-able.

Why is this happening ? Is there a way to fix this ?

Thanks!


The file is not "ラドクリフ.xml" it is "ラドクリフ.xml" note the xml at the end of the filename is not ASCII; they are full width Roman letters i.e. UniCode codepoints 0xFF00-0xFFEF.

The fix is for your users to switch back to ASCII input when typing the .xml at the end, or if your software is localised for Japanese add full width "*.xml" to your list of filters.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜