Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect encoding for Chinese characters in log output #4415

Closed
achieve-dream1221 opened this issue Sep 15, 2024 · 0 comments
Closed

Incorrect encoding for Chinese characters in log output #4415

achieve-dream1221 opened this issue Sep 15, 2024 · 0 comments

Comments

@achieve-dream1221
Copy link

achieve-dream1221 commented Sep 15, 2024

When logging Chinese characters using quill, the output encoding is incorrect.
image

Steps for Reproduction
Code Example:

#include <quill/Logger.h>
#include <quill/Frontend.h>
#include <quill/LogMacros.h>
#include <quill/sinks/ConsoleSink.h>
#include "quill/Backend.h"

int main() {
    quill::Backend::start();
    quill::Logger *logger = quill::Frontend::create_or_get_logger(
        "root", quill::Frontend::create_or_get_sink<quill::ConsoleSink>("sink")
    );
    logger->set_log_level(quill::LogLevel::Debug);
    LOG_DEBUG(logger, "Hello World!");
    LOG_INFO(logger, "你好");
    LOG_INFO(logger, "你好{}", "hello");
    LOG_INFO(logger, "你好", "hello");
    return 0;
}
add_executable(mainTest main.cpp)
target_compile_options(mainTest PRIVATE /source-charset:utf-8 /execution-charset:gb2312)
target_link_libraries(mainTest PRIVATE quill::quill)

Expected behavior:
16:44:21.105184397 [25956] main.cpp:18 LOG_DEBUG root Hello World!
16:44:21.105442207 [25956] main.cpp:19 LOG_INFO root 你好
16:44:21.105442488 [25956] main.cpp:20 LOG_INFO root 你好hello
16:44:21.105443490 [25956] main.cpp:21 LOG_INFO root 你好hello
Actual behavior:

Platforms:

Include browser, operating system and respective versions
Windows 11 专业版 23H2 22631.4112
Version:
70100
Run Quill.version to find out

@achieve-dream1221 achieve-dream1221 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant