Lubomir I. Ivanov
2014-10-29 15:32:58 UTC
hi Thiogo,
related to bug #740
where special chars in Win32 file names no longer work (again).
in mainwindow.cpp we have some ::encodeName() calls.
as i understand it on Qt4 it should work because of the setup in qt-qui.cpp.
but for Qt5:
http://qt-project.org/doc/qt-5/sourcebreaks.html:
QFile::setEncodingFunction() and QFile::setDecodingFunction() are
deprecated. The QFile::encodeName() andQFile::decodeName() functions
are now hard-coded to operate on QString::fromLocal8Bit() and
QString::toLocal8Bit() only. The old behavior is still possible using
QTextCodec::setCodecForLocale(), but it is recommended that the new
code should not make assumptions about the file system encoding and
older code should remove such assumptions.
now, i know how to fix the issue by simply not use File::encodeName()
at all on Win32 and use QString::toUtf8() instead but is there a
cleaner way with no #ifdefs?
not sure if QTextCodec::setCodecForLocale() should be set to Utf8 on Win32...
lubomir
--
related to bug #740
where special chars in Win32 file names no longer work (again).
in mainwindow.cpp we have some ::encodeName() calls.
as i understand it on Qt4 it should work because of the setup in qt-qui.cpp.
but for Qt5:
http://qt-project.org/doc/qt-5/sourcebreaks.html:
QFile::setEncodingFunction() and QFile::setDecodingFunction() are
deprecated. The QFile::encodeName() andQFile::decodeName() functions
are now hard-coded to operate on QString::fromLocal8Bit() and
QString::toLocal8Bit() only. The old behavior is still possible using
QTextCodec::setCodecForLocale(), but it is recommended that the new
code should not make assumptions about the file system encoding and
older code should remove such assumptions.
now, i know how to fix the issue by simply not use File::encodeName()
at all on Win32 and use QString::toUtf8() instead but is there a
cleaner way with no #ifdefs?
not sure if QTextCodec::setCodecForLocale() should be set to Utf8 on Win32...
lubomir
--