diff -r 000000000000 -r e4d67989cc36 genericopenlibs/cppstdlib/stl/test/eh/locale.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/cppstdlib/stl/test/eh/locale.cpp Tue Feb 02 02:01:42 2010 +0200 @@ -0,0 +1,60 @@ +#include +#include +#include +#include + +using namespace std; + +void main() +{ + try + { + locale c_loc; + //locale sys(c_loc, "LC_TIME=UKR_UKR.OCP;LC_NUMERIC=RUS_RUS.OCP;LC_CTYPE=ukr_ukr.ocp;", locale::numeric | locale::time | locale::ctype); + locale sys(".ocp"); + locale::global(sys); + cin.imbue(sys); + cout.imbue(sys); + + cout<<"Locale name is: "<>value; + cout<& num_punct=use_facet >(cout.getloc()); + cout << num_punct.decimal_point() << '\n'; + const time_put > >& time_fac= + use_facet > > >(cout.getloc()); + time_fac.put(cout, cout, NULL, cur_time, 'x'); cout<<'\n'; + time_fac.put(cout, cout, NULL, cur_time, 'x', '#'); cout<<'\n'; + time_fac.put(cout, cout, NULL, cur_time, 'X'); cout<<'\n'; + time_fac.put(cout, cout, NULL, cur_time, 'c'); cout<<'\n'; + time_fac.put(cout, cout, NULL, cur_time, 'c', '#'); cout<<'\n'; + time_fac.put(cout, cout, NULL, cur_time, 'I'); cout<<'\n'; + + const ctype& char_type=use_facet >(cout.getloc()); + if(char_type.is(ctype_base::upper, '')) puts("Upper"); + if(char_type.is(ctype_base::lower, '')) puts("Lower"); + puts("Next"); + if(isupper('', cout.getloc())) puts("Upper"); + if(islower('', cout.getloc())) puts("Lower"); + /*for(int ch=128; ch<256; ch++) + printf("Character %c (%d) - upper %c, lower %c\n",(char)ch, ch,toupper((char)ch, cout.getloc()), tolower((char)ch, cout.getloc()));*/ + } + catch(exception &e) + { + cout<<"Exception fired:\n"<