#587 money_put & money_get do not work

closed-invalid
nobody
gcc (462)
2004-06-10
2004-06-09
Paul
No

The i18n & l10n in MinGW seem not to work compared
with their same unix version build.

They really don't seem to work at all on Windows 2000
for non-trivial locales.

Here is a money_get example that works on unix but not
on MinGW:
#include <locale>
#include <string>
#include <sstream>
#include <iostream>

using namespace std;

namespace {

void doit(const string& amount)
{
// Use a non-trivial locale by setting
LANG=en_US.UTF8 (for
// example).
istringstream istrm(amount);
istrm.imbue(locale(""));

// Retrieve the money_get facet.
const money_get<char>& mgf =
use_facet< money_get <char> >(istrm.getloc
());

// Use the facet to extract the amount from istrm.
string extracted_amount;
ios_base::iostate err = ios_base::iostate(0);
mgf.get(istrm, 0, false, istrm, err,
extracted_amount);

// Check for errors.
if( err & ios_base::failbit ) {
extracted_amount = "<error>";
}

// What did we get?
cout << "amount = " << extracted_amount <<
endl;
}

}

int main(int argc, char* argv[])
{
int rv = 0;
doit("$.05");
doit("$.04");
doit("$.03");
doit("$.02");
doit("$.01");

return rv;
}

// Windows results in:
amount = <error>
amount = <error>
amount = <error>
amount = <error>
amount = <error>

// Linux results in
amount = 5
amount = 4
amount = 3
amount = 2
amount = 1

money_put seems like it should be easier than
money_get and it has just as many problems.

Discussion

  • Earnie Boyd

    Earnie Boyd - 2004-06-10
    • labels: 456608 --> gcc
    • assigned_to: earnie --> dannysmith
    • priority: 5 --> 3
     
  • Earnie Boyd

    Earnie Boyd - 2004-06-10

    Logged In: YES
    user_id=15438

    Perhaps you should ask a GNU stdc++ forum.

    Danny, I assigned this to you just for reference, do with it
    what you want.

     
  • Danny Smith

    Danny Smith - 2004-06-10

    Logged In: YES
    user_id=11494

    libstdc++ does not support a win32 locale model. Nor does
    mingw support a nl_langinfo interface to the native locale
    model. Hence, libstdc++ falls back to a very dumb model that
    only really supports "C" locale.

    This will be fixed when someone thinks it is important enough
    to fix.

    Danny

     
  • Earnie Boyd

    Earnie Boyd - 2004-06-10
    • assigned_to: dannysmith --> nobody
    • status: open --> closed-invalid
     
  • Earnie Boyd

    Earnie Boyd - 2004-06-10

    Logged In: YES
    user_id=15438

    Based on Danny's response, I'm closing this as invalidly
    reported. If you wish to enter an RFE to include the
    feature at a later date you may do so.

     
  • Paul

    Paul - 2004-06-10

    Logged In: YES
    user_id=1020320

    I'm actually offended that you have marked this "invalidly
    reported".
    dannysmith has properly stated that this is a legitimate bug
    but until now no one has thought it was important enough to
    fix. (note the key word is "fix")
    Dismissing this BUG is a mistake. It is not a RFE.

     
  • Paul

    Paul - 2004-06-10
    • priority: 3 --> 7
    • status: closed-invalid --> open
     
  • Earnie Boyd

    Earnie Boyd - 2004-06-10
    • status: open --> closed-invalid
     
  • Earnie Boyd

    Earnie Boyd - 2004-06-10

    Logged In: YES
    user_id=15438

    He didn't say that it was a bug, he said that the feature
    isn't present. If the feature hasn't been coded for, then
    there can't be a bug. He used the word "fix" genericly to
    mean when someone adds the code to supply the feature to
    remove your presumed bug.

    Open a RFE, this is not a bug.

     
  • Paul

    Paul - 2004-06-10

    Logged In: YES
    user_id=1020320

    Fine, I will.
    One question though, since you are the admin, why don't you
    just change this "group" to "feature request"?

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks