https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86419
Dimitrij Mijoski <dmjpp at hotmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|codecvt<char16_t, |codecvt<char16_t, |...>::in() and out() |...>::in() and out() |incorrectly return partial |incorrectly return ok in |in some cases. |some cases. --- Comment #4 from Dimitrij Mijoski <dmjpp at hotmail dot com> --- I think i found where the bug lies. It lies in 1. line 557 of the file c++11/codecvt.cc https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libstdc%2B%2B-v3/src/c%2B%2B11/codecvt.cc;h=0311b15177d0439757e0347f7934b5a09b78f8e3;hb=HEAD#l557 . The return of the function utf16_in() should be: return from.size() ? codecvt_base::partial : codecvt_base::ok; The bug is triggered because the loop exists because t.size() is zero. from.size() should be checked. 2.