diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-05 13:36:21 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-05 13:36:21 +0000 |
commit | a6cb48248daca55a8b659c1242261a58175fec8a (patch) | |
tree | 50604d2946731d58d3d58508dcad099b1efe9b27 /libstdc++-v3/include/bits | |
parent | fece9deff44f6247e12f74f302c000486d3adf48 (diff) | |
download | gcc-a6cb48248daca55a8b659c1242261a58175fec8a.tar.gz |
* include/bits/locale_conv.h (wstring_convert::_M_conv): Handle
noconv result.
* testsuite/22_locale/conversions/string/2.cc: Also test UTF-8.
* testsuite/22_locale/conversions/string/3.cc: Likewise, and UTF-16.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221212 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits')
-rw-r--r-- | libstdc++-v3/include/bits/locale_conv.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libstdc++-v3/include/bits/locale_conv.h b/libstdc++-v3/include/bits/locale_conv.h index b53754d1541..9b49617b7a9 100644 --- a/libstdc++-v3/include/bits/locale_conv.h +++ b/libstdc++-v3/include/bits/locale_conv.h @@ -213,6 +213,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION while (__result == codecvt_base::partial && __next != __last && (__outstr.size() - __outchars) < __maxlen); + if (__result == codecvt_base::noconv) + { + __outstr.assign(__first, __last); + _M_count = __outstr.size(); + return __outstr; + } + __outstr.resize(__outchars); _M_count = __next - __first; |