From: SourceForge.net <no...@so...> - 2004-06-10 11:27:08
|
Bugs item #969845, was opened at 2004-06-09 15:44 Message generated for change (Comment added) made by earnie You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=969845&group_id=2435 Category: gcc Group: None >Status: Closed >Resolution: Invalid Priority: 3 Submitted By: Paul (pdemarco) >Assigned to: Nobody/Anonymous (nobody) Summary: money_put & money_get do not work Initial Comment: 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. ---------------------------------------------------------------------- >Comment By: Earnie Boyd (earnie) Date: 2004-06-10 07:27 Message: 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. ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2004-06-10 07:17 Message: 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 ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2004-06-10 07:10 Message: 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=969845&group_id=2435 |