diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-12-27 12:42:26 -0800 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-12-28 15:29:02 +0000 |
commit | 44da5b863597e761df3545dc7ff02a9b53bbb13d (patch) | |
tree | d2905031af1a234a610a421abf3d66a2ed64feeb /src | |
parent | 6f7b64e2a97034f84991e644abd609e73895ffb9 (diff) | |
download | qtbase-44da5b863597e761df3545dc7ff02a9b53bbb13d.tar.gz |
Allow moc to handle Unicode output filenames on Windows with MSVC
The C standard library functions cannot handle UTF-8 filenames. Instead,
we need to use the wide-character versions which accept UTF-16 input.
Task-number: QTBUG-65492
Change-Id: If4b3b4eeeec4f3bbb428b8f6b0311a65d01463b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/moc/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp index 98cc9652ab..dfcc23f0d6 100644 --- a/src/tools/moc/main.cpp +++ b/src/tools/moc/main.cpp @@ -486,8 +486,8 @@ int runMoc(int argc, char **argv) // 3. and output meta object code if (output.size()) { // output file specified -#if defined(_MSC_VER) && _MSC_VER >= 1400 - if (fopen_s(&out, QFile::encodeName(output).constData(), "w")) +#if defined(_MSC_VER) + if (_wfopen_s(&out, reinterpret_cast<const wchar_t *>(output.utf16()), L"w") != 0) #else out = fopen(QFile::encodeName(output).constData(), "w"); // create output file if (!out) |