Add Windows i18n support (#617)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user