Skip to content

Crash when using fmt with gcc to print chinese character #4162

@DarrenCHEN425

Description

@DarrenCHEN425

I want to print chinese character with fmt::print. Here is my code.

#define FMT_HEADER_ONLY
#include <fmt/printf.h>
int main() {
    fmt::print(" 我喜欢fmt \n");
    fmt::print("I like fmt\n");
    while (1) {
        // do nothing
    }
    return 0;
}

My toolchain is mingw-w64 + gcc8.5.0, and my source file is saved as utf-8. When built with options -finput-charset=utf-8 -fexec-charset=gb2312, the generated exe prints nothing but just exits.

FMT-11.0.2 and FMT-10.2.1 are both tested, and the results are same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions