Add Windows i18n support (#617)

This commit is contained in:
Nikolay Igotti
2017-05-31 10:01:49 +03:00
committed by GitHub
parent 4f9a1e9a33
commit 74ffc479bb
9 changed files with 27 additions and 28 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ ffi_type* convertFfiTypeKindToType(FfiTypeKind typeKind) {
case FFI_TYPE_KIND_DOUBLE: return &ffi_type_double;
case FFI_TYPE_KIND_POINTER: return &ffi_type_pointer;
default: assert(false);
default: assert(false); return nullptr;
}
}
+9
View File
@@ -15,6 +15,9 @@
*/
#include <stdio.h>
#if KONAN_WINDOWS
#include <windows.h>
#endif
#include "Memory.h"
#include "Runtime.h"
@@ -64,6 +67,12 @@ RuntimeState* InitRuntime() {
result->memoryState = InitMemory();
// Keep global variables in state as well.
InitGlobalVariables();
#if KONAN_WINDOWS
// Note that this code enforces UTF-8 console output, so we may want to rethink
// how we perform console IO, if it turns out, that UTF-16 is better output format.
SetConsoleCP(CP_UTF8);
SetConsoleOutputCP(CP_UTF8);
#endif
return result;
}