Support utf8 codepoint in win32 console

This commit is contained in:
2025-03-05 16:55:08 -05:00
parent 764824ff24
commit 231fea81dd
2 changed files with 12 additions and 1 deletions

View File

@@ -65,5 +65,5 @@ extern "C" __declspec(dllexport) void __cdecl GameShutdown()
extern "C" __declspec(dllexport) void __cdecl GameUpdate(float deltaTime) extern "C" __declspec(dllexport) void __cdecl GameUpdate(float deltaTime)
{ {
printf("Updating game...\n"); //printf("Updating game...\n");
} }

View File

@@ -7,8 +7,12 @@
#include <cstdarg> #include <cstdarg>
// Begin Todo JULIET debug output // Begin Todo JULIET debug output
#include <cinttypes>
#ifdef JULIET_WIN32
#include <Core/HAL/Win32.h> #include <Core/HAL/Win32.h>
#include <debugapi.h> #include <debugapi.h>
#endif
// End Todo // End Todo
namespace Juliet namespace Juliet
@@ -62,12 +66,19 @@ namespace Juliet
void LogManager::OutputLog(Entry& entry) void LogManager::OutputLog(Entry& entry)
{ {
// TODO Juliet Output io for each platform // TODO Juliet Output io for each platform
#ifdef JULIET_WIN32
OutputDebugStringA((entry.Value + "\n").c_str()); OutputDebugStringA((entry.Value + "\n").c_str());
#endif
printf("%s", (entry.Value + "\n").c_str()); printf("%s", (entry.Value + "\n").c_str());
} }
void InitializeLogManager() void InitializeLogManager()
{ {
#ifdef JULIET_WIN32
SetConsoleOutputCP(CP_UTF8);
SetConsoleCP(CP_UTF8);
#endif
LogManagerSingleton.Init(); LogManagerSingleton.Init();
} }