This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/79511] Convertation issues in std::codecvt_utf8_utf16


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79511

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
And this is the fix for comment 3:

--- a/libstdc++-v3/src/c++11/codecvt.cc
+++ b/libstdc++-v3/src/c++11/codecvt.cc
@@ -315,7 +315,7 @@ namespace
   {
     static_assert(sizeof(C) >= 2, "a code unit must be at least 16-bit");

-    if (codepoint < max_single_utf16_unit)
+    if (codepoint <= max_single_utf16_unit)
       {
        if (to.size() > 0)
          {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]