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

Error when compile program using libfmt with gcc -fexec-charset #3154

Closed
royqh1979 opened this issue Oct 26, 2022 · 1 comment
Closed

Error when compile program using libfmt with gcc -fexec-charset #3154

royqh1979 opened this issue Oct 26, 2022 · 1 comment

Comments

@royqh1979
Copy link

When I'm trying to build a simple test program using gcc with argument -fexec-charset, I got the following error:

In file included from D:/MinGW32/i686-w64-mingw32/include/fmt/format.h:48,
                 from test.cpp:1:
D:/MinGW32/i686-w64-mingw32/include/fmt/core.h:413:68: error: converting UCN to execution character set: Illegal byte sequence
 FMT_MSC_WARNING(suppress : 4566) constexpr unsigned char micro[] = "\u00B5";
                                                                    ^~~~~~~~

The command used to compile is:

R:\RedPanda-Release\RedPandaIDE>gcc test.cpp -finput-charset=UTF-8 -fexec-charset=gbk
In file included from D:/MinGW32/x86_64-w64-mingw32/include/fmt/format.h:49,
                 from test.cpp:1:
D:/MinGW32/x86_64-w64-mingw32/include/fmt/core.h:411:68: error: converting UCN to execution character set: Illegal byte sequence
  411 | FMT_MSC_WARNING(suppress : 4566) constexpr unsigned char micro[] = "\u00B5";

And the test problem is:

#include <fmt/format.h>

int main() {
	fmt::print("test");
	return 0;
}
@vitaut
Copy link
Contributor

vitaut commented Nov 2, 2022

In general it's recommended to use Unicode instead of legacy encodings but this particular error has been fixed in fc07217 by switching to a more widely available character for Unicode detection.

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

2 participants