I build a QT project on CentOS 7.I have changed the /etc/locale.conf to 'zh_CN.gb2312'.
when I open QFiledialog without 'DontUseNativeDialog' to chose a file , the file name displays in the dialog occurs messy code, even I add these following code in the main():
QTextCodec::setCodecForTr(QTextCodec::codecForName("GB2312"));
QTextCodec::setCodecForLocale(QTextCodec::codecForName("GB2312"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("GB2312"));
How to fix this problem ? My app will not only support English or Chinese , It should compatible with all the languages within the linux . The QT must can check the system language automatically, but how to ?
Thanks .