PR libstdc++/87642 handle multibyte thousands separators from libc
authorJonathan Wakely <jwakely@redhat.com>
Thu, 18 Oct 2018 19:57:25 +0000 (20:57 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 18 Oct 2018 19:57:25 +0000 (20:57 +0100)
commitc0ace69ec677d1f85f6a433c8fae2d4df6f75714
tree0a7d0563651b52790d3f60374000b3fd66907694
parente8ce849a483cacda23eb12989a1fb3d8a0e5b634
PR libstdc++/87642 handle multibyte thousands separators from libc

If a locale's THOUSANDS_SEP or MON_THOUSANDS_SEP string is not a
single character we either need to narrow it to a single char or
ignore it (and therefore disable digit grouping for that facet).

PR libstdc++/87642
* config/locale/gnu/monetary_members.cc
(moneypunct<char, true>::_M_initialize_moneypunct): Use
__narrow_multibyte_chars to convert multibyte thousands separators
to a single char.
* config/locale/gnu/numeric_members.cc
(numpunct<char>::_M_initialize_numpunct): Likewise.
(__narrow_multibyte_chars): New function.

From-SVN: r265286
libstdc++-v3/ChangeLog
libstdc++-v3/config/locale/gnu/monetary_members.cc
libstdc++-v3/config/locale/gnu/numeric_members.cc