public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libstdc++/6410: Troble with non-Ascii monetary symbols and wchar_t
@ 2002-04-22 10:26 pcarlini
  0 siblings, 0 replies; only message in thread
From: pcarlini @ 2002-04-22 10:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6410
>Category:       libstdc++
>Synopsis:       Troble with non-Ascii monetary symbols and wchar_t
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 22 10:26:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Paolo Carlini
>Release:        3.1 20020417
>Organization:
>Environment:
x86-linux, glibc2.2.5 (gnu locale model)
>Description:
Trying to fix the testsuite to work well with the new EURO localedata (present in glibc CVS, both 2.2 and mainline) exposed what seems to be a problem with non-Ascii monetary symbols and wchar_t.
This is a testcase:

#include <locale>
#include <sstream>
#include <cassert>

int main()
{
  using namespace std;
  typedef ostreambuf_iterator<wchar_t> iterator_type;

  locale loc_de("de_DE@euro");

  const wstring empty;
  const wstring digits1(L"720000000000");

  wostringstream oss;
  oss.imbue(loc_de);

  const money_put<wchar_t>& mon_put = use_facet<money_put<wchar_t> >(oss.getloc()); 

  oss.setf(ios_base::showbase);

  oss.str(empty);
  iterator_type os_it04 = mon_put.put(oss.rdbuf(), false, oss, ' ', digits1);
  wstring result4 = oss.str();
  assert( result4 == L"7.200.000.000,00 \244");
}
>How-To-Repeat:

>Fix:
Most probably, the culprit is the use of mbsrtowcs in config/locale/gnu/monetary_members.cc, which actually needs an appropriate setlocale in order to deal correctly with non-Ascii chars.
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-04-22 17:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-22 10:26 libstdc++/6410: Troble with non-Ascii monetary symbols and wchar_t pcarlini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).