Commit 2cd356a8 authored by Andreas Traczyk's avatar Andreas Traczyk

i18n: define unicode macro to force wstring win32 apis

- sets the console codepage to utf-8
- sets locale to utf-8 for mbstowcs/wcstombs

Change-Id: I09c964b7e04e5962021da93db94d017854b46e46
parent 08748397
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <QTranslator> #include <QTranslator>
#include <ciso646> #include <ciso646>
#include <locale.h>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <windows.h> #include <windows.h>
...@@ -49,6 +50,8 @@ consoleDebug() ...@@ -49,6 +50,8 @@ consoleDebug()
{ {
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
AllocConsole(); AllocConsole();
SetConsoleCP(CP_UTF8);
freopen("CONOUT$", "w", stdout); freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr); freopen("CONOUT$", "w", stderr);
...@@ -93,6 +96,8 @@ fileDebug(QFile& debugFile) ...@@ -93,6 +96,8 @@ fileDebug(QFile& debugFile)
int int
main(int argc, char* argv[]) main(int argc, char* argv[])
{ {
setlocale(LC_ALL, "en_US.utf8");
char ARG_DISABLE_WEB_SECURITY[] = "--disable-web-security"; char ARG_DISABLE_WEB_SECURITY[] = "--disable-web-security";
int newArgc = argc + 1 + 1; int newArgc = argc + 1 + 1;
char** newArgv = new char*[newArgc]; char** newArgv = new char*[newArgc];
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<OutputDirectory>release\</OutputDirectory> <OutputDirectory>release\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage> <ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<IntermediateDirectory>release\</IntermediateDirectory> <IntermediateDirectory>release\</IntermediateDirectory>
<PrimaryOutput>Jami</PrimaryOutput> <PrimaryOutput>Jami</PrimaryOutput>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>release\</AssemblerListingLocation> <AssemblerListingLocation>release\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation> <BrowseInformation>false</BrowseInformation>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment