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>bb10
parent
6f7b64e2a9
commit
44da5b8635
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue