[Bug libstdc++/70893] codecvt incorrectly decodes UTF-16

2016-05-01 Thread kirillnow at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70893 --- Comment #2 from Кирилл --- ... Just realized its wrong endianness problem. codecvt_utf8_utf16 should assume utf16be by default, right? Apparently, no.

[Bug libstdc++/70893] codecvt incorrectly decodes UTF-16

2016-05-01 Thread kirillnow at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70893 --- Comment #1 from Кирилл --- Bad guess on my part, sorry! Actual problem is: 305:else if (is_low_surrogate(c)) 306: return invalid_mb_sequence; Stand-alone low surrogates are not uncommon, and could be decoded as valid utf-8. Example: