# # # patch "ChangeLog" # from [e740b27fde448d4ea8815b882e631795d31ace3a] # to [ec8f4d2703cf584434b718a6d72a07f11215aa38] # # patch "transforms.cc" # from [d530e6715819b76c4173dc4afc3d3341da60b0a0] # to [a1fe770e8fff896e7fb29a16e3154ed6e427042c] # ============================================================ --- ChangeLog e740b27fde448d4ea8815b882e631795d31ace3a +++ ChangeLog ec8f4d2703cf584434b718a6d72a07f11215aa38 @@ -1,5 +1,7 @@ 2006-03-01 Matthew Gregan + * transforms.cc: Don't assume wchar_t is wide enough to hold a + UCS-4 character. * transforms.cc, transforms.hh: Add utf8_validate function and some validity unit tests. (system_to_utf8): Check that conversion has resulted in valid ============================================================ --- transforms.cc d530e6715819b76c4173dc4afc3d3341da60b0a0 +++ transforms.cc a1fe770e8fff896e7fb29a16e3154ed6e427042c @@ -600,7 +600,7 @@ // from the file gutf8.c of the GLib library. static bool -is_valid_unicode_char(wchar_t c) +is_valid_unicode_char(unsigned int c) { return (c < 0x110000 && ((c & 0xfffff800) != 0xd800) && @@ -609,7 +609,7 @@ } static bool -utf8_consume_continuation_char(unsigned char c, wchar_t & val) +utf8_consume_continuation_char(unsigned char c, unsigned int & val) { if ((c & 0xc0) != 0x80) return false; @@ -622,7 +622,7 @@ utf8_validate(utf8 const & utf) { std::string::size_type left = utf().size(); - wchar_t min, val; + unsigned int min, val; for (std::string::const_iterator i = utf().begin(); i != utf().end(); ++i, --left)