Some library in Boost can not build with msvc if system default codepage is multi-bytes charset.

For example, Boost.Regex use some characters with 128-255 ansi code in source file, and msvc will convert them to Unicode using default codepage. If the default codepage is an multi-bytes charset, that convertion would truncate some of string declaration. For Unicode string, sometimes it would not raise an error on compile time, but it does the worse thing. L"aa汉aa" has different means for different codepages, and L"\xAB\x9A" does not. I think all file in boost should only contains 0-127 ansi code, and any other characters need for string or char declaration should use \x instead.

Atry wrote:
For example, Boost.Regex use some characters with 128-255 ansi code in source file, and msvc will convert them to Unicode using default codepage. If the default codepage is an multi-bytes charset, that convertion would truncate some of string declaration.
For Unicode string, sometimes it would not raise an error on compile time, but it does the worse thing. L"aa?aa" has different means for different codepages, and L"\xAB\x9A" does not.
But, is this the problem in your code? In other words, do you have the problem if you save your file in unicode format?
I think all file in boost should only contains 0-127 ansi code, and any other characters need for string or char declaration should use \x instead.
This looks like a little difficult to me, some author's names have ascii code > 127. Anyway, it is not a problem if such codes appear only in comments.

gchen 写道:
Atry wrote:
For example, Boost.Regex use some characters with 128-255 ansi code in source file, and msvc will convert them to Unicode using default codepage. If the default codepage is an multi-bytes charset, that convertion would truncate some of string declaration.
For Unicode string, sometimes it would not raise an error on compile time, but it does the worse thing. L"aa?aa" has different means for different codepages, and L"\xAB\x9A" does not.
But, is this the problem in your code? In other words, do you have the problem if you save your file in unicode format?
I think all file in boost should only contains 0-127 ansi code, and any other characters need for string or char declaration should use \x instead.
This looks like a little difficult to me, some author's names have ascii code > 127. Anyway, it is not a problem if such codes appear only in comments.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
But, some ascii code > 127 appears in a string..., and unable to compile on msvc if system default codepage is multi-bytes. Boost.Wave and Boost.Regex is some of these library.

Atry wrote:
This looks like a little difficult to me, some author's names have ascii code > 127. Anyway, it is not a problem if such codes appear only in comments.
But, some ascii code > 127 appears in a string..., and unable to compile on msvc if system default codepage is multi-bytes. Boost.Wave and Boost.Regex is some of these library.
Could you be a bit more specific, please? What files in Wave? What lines? Either submit a patch, please, or just point it out to me. I'll try to fix it if possible. Regards Hartmut

Hartmut Kaiser wrote:
Atry wrote:
This looks like a little difficult to me, some author's names have ascii code > 127. Anyway, it is not a problem if such codes appear only in comments. But, some ascii code > 127 appears in a string..., and unable to compile on msvc if system default codepage is multi-bytes. Boost.Wave and Boost.Regex is some of these library.
Could you be a bit more specific, please? What files in Wave? What lines? Either submit a patch, please, or just point it out to me. I'll try to fix it if possible.
Regards Hartmut
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
See cpp_macromap.hpp.txt . --- cpp_macromap.hpp 2007-03-08 21:57:09.000000000 +0800 +++ cpp_macromap2.hpp 2007-05-02 22:14:36.781250000 +0800 @@ -680,7 +680,7 @@ #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 if (boost::wave::need_variadics(ctx.get_language())) { // store a placemarker as the argument - argument->push_back(token_type(T_PLACEMARKER, "§", + argument->push_back(token_type(T_PLACEMARKER, "\xA7" (*next).get_position())); ++count_arguments; } @@ -705,7 +705,7 @@ #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 if (boost::wave::need_variadics(ctx.get_language())) { // store a placemarker as the argument - argument->push_back(token_type(T_PLACEMARKER, "§", + argument->push_back(token_type(T_PLACEMARKER, "\xA7" (*next).get_position())); ++count_arguments; }
participants (3)
-
Atry
-
gchen
-
Hartmut Kaiser