Index: utf8_codecvt_facet.cpp =================================================================== RCS file: /cvsroot/boost/boost/libs/program_options/src/utf8_codecvt_facet.cpp,v retrieving revision 1.7 diff -u -r1.7 utf8_codecvt_facet.cpp --- utf8_codecvt_facet.cpp 21 Jul 2004 07:49:15 -0000 1.7 +++ utf8_codecvt_facet.cpp 22 Jul 2004 07:53:14 -0000 @@ -13,6 +13,8 @@ #define BOOST_PROGRAM_OPTIONS_SOURCE #include +#include + namespace boost { namespace program_options { namespace detail { /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // implementation for wchar_t @@ -110,10 +112,11 @@ 0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc }; + wchar_t max_wchar = std::numeric_limits::max(); while (from != from_end && to != to_end) { // Check for invalid UCS-4 character - if (*from > WCHAR_MAX) { + if (*from > max_wchar) { from_next = from; to_next = to; return std::codecvt_base::error;