Correctly log config values

This commit is contained in:
Yukino Song
2024-10-06 05:28:57 +08:00
parent 05763a0b79
commit d8b98e4906
3 changed files with 11 additions and 4 deletions

View File

@@ -28,6 +28,7 @@
#ifdef _WIN32 #ifdef _WIN32
#include <shellapi.h> #include <shellapi.h>
#include "platform/windows/utils.h"
#endif #endif
#ifndef __APPLE__ #ifndef __APPLE__
@@ -979,7 +980,11 @@ namespace config {
} }
for (auto &[name, val] : vars) { for (auto &[name, val] : vars) {
#ifdef _WIN32
std::cout << "["sv << name << "] -- ["sv << convertUtf8ToCurrentCodepage(val) << ']' << std::endl;
#else
std::cout << "["sv << name << "] -- ["sv << val << ']' << std::endl; std::cout << "["sv << name << "] -- ["sv << val << ']' << std::endl;
#endif
} }
bool_f(vars, "headless_mode", video.headless_mode); bool_f(vars, "headless_mode", video.headless_mode);

View File

@@ -1,5 +1,10 @@
#include "utils.h" #include "utils.h"
#include <SetupApi.h>
#include "src/utility.h"
#include "src/logging.h"
std::wstring acpToUtf16(const std::string& origStr) { std::wstring acpToUtf16(const std::string& origStr) {
auto acp = GetACP(); auto acp = GetACP();

View File

@@ -1,14 +1,11 @@
#pragma once #pragma once
#include <string> #include <string>
#include <vector>
#include <windows.h> #include <windows.h>
#include <SetupApi.h>
#include <wtsapi32.h> #include <wtsapi32.h>
#include "src/utility.h"
#include "src/logging.h"
std::wstring acpToUtf16(const std::string& origStr); std::wstring acpToUtf16(const std::string& origStr);
std::string utf16toAcp(const std::wstring& utf16Str); std::string utf16toAcp(const std::wstring& utf16Str);
std::string convertUtf8ToCurrentCodepage(const std::string& utf8Str); std::string convertUtf8ToCurrentCodepage(const std::string& utf8Str);