diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2010-03-16 21:32:28 (GMT) |
---|---|---|
committer | Alessandro Portale <alessandro.portale@nokia.com> | 2010-03-16 21:32:28 (GMT) |
commit | 24096c5613731ae19e8fefe071570fa1d0e7ab36 (patch) | |
tree | 87b3bc95e528057f5178a3718be0715dde56fcf4 /src/corelib | |
parent | 3675bfca72e8e848a3a547dfc68fadbd775e973b (diff) | |
download | Qt-24096c5613731ae19e8fefe071570fa1d0e7ab36.zip Qt-24096c5613731ae19e8fefe071570fa1d0e7ab36.tar.gz Qt-24096c5613731ae19e8fefe071570fa1d0e7ab36.tar.bz2 |
Handle Symbian's file name encoding, correctly.
On Symbian, we incorrectly assumed that filenames are encoded in
local8bit. OpenC's implementation of wcstombs, mbstowcs, etc. are all
UTF-8, regardless of the locale.
Task-number: QTBUG-7175
Reviewed-by: Shane Kearns
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qfile.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 728c316..aa1c7d9 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -62,21 +62,25 @@ static const int QFILE_WRITEBUFFER_SIZE = 16384; static QByteArray locale_encode(const QString &f) { -#ifndef Q_OS_DARWIN - return f.toLocal8Bit(); -#else +#if defined(Q_OS_DARWIN) // Mac always expects UTF-8... and decomposed... return f.normalized(QString::NormalizationForm_D).toUtf8(); +#elif defined(Q_OS_SYMBIAN) + return f.toUtf8(); +#else + return f.toLocal8Bit(); #endif } static QString locale_decode(const QByteArray &f) { -#ifndef Q_OS_DARWIN - return QString::fromLocal8Bit(f); -#else +#if defined(Q_OS_DARWIN) // Mac always gives us UTF-8 and decomposed, we want that composed... return QString::fromUtf8(f).normalized(QString::NormalizationForm_C); +#elif defined(Q_OS_SYMBIAN) + return QString::fromUtf8(f); +#else + return QString::fromLocal8Bit(f); #endif } |