Skip to content

Does spdlog support utf-8 encoding in Linux? #2462

Answered by tt4g
RonnieHu asked this question in Q&A
Discussion options

You must be logged in to vote

Short answer: spdlog does not support char * character encoding conversion.

Long answer: In the C/C++ language, there is no character encoding specification for char *. The lack of specification means that it is compiler and platform (OS) dependent.
Since there is no language specification, there is no way to know spdlog the character encoding of the data assigned to char *.

However, most Linux OS treat char * in source code as UTF-8 encoding.
More strictly, the GCC compiler uses the exec-charset option to determine the character encoding of char * in the source code (https://gcc.gnu.org/onlinedocs/cpp/Invocation.html).
It is safe to assume that the character encoding used by the compiler…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@tt4g
Comment options

Answer selected by RonnieHu
Comment options

You must be logged in to vote
1 reply
@tt4g
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants