 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
cris Guest
|
Posted: Mon Nov 27, 2006 10:11 am Post subject: Utilise les locale de la machine unix |
|
|
Bonjour,
J'ai des soucis lorsque je change le "locale" utilisé :
// ----------------- begin
#include <iostream>
#include <locale>
#include <exception>
using namespace std;
int main(int argc, char** argv)
{
try{
locale l(argv[1]);
cout.imbue(l);
cout << "Set locale to " << l.name() << " works" << endl;
}
catch (std::runtime_error& e)
{
cout << argv[1] << " : " << e.what() << endl;
}
}
// ----------------- end
g++ -o foo foo.cc
J'essaie chacun des locale dispo sur la machine unix :
for loc in `locale -a`; do ./foo $loc; done
Certain locale marche mais pas tous :
Set locale to C works
common : locale::facet::_S_create_c_locale name not valid
en_US.UTF-8 : locale::facet::_S_create_c_locale name not valid
Set locale to C works
iso_8859_1 : locale::facet::_S_create_c_locale name not valid
iso_8859_15 : locale::facet::_S_create_c_locale name not valid
en_CA : locale::facet::_S_create_c_locale name not valid
en_CA.ISO8859-1 : locale::facet::_S_create_c_locale name not valid
en_US : locale::facet::_S_create_c_locale name not valid
en_US.ISO8859-1 : locale::facet::_S_create_c_locale name not valid
en_US.ISO8859-15 : locale::facet::_S_create_c_locale name not valid
en_US.ISO8859-15@euro : locale::facet::_S_create_c_locale name not
valid
fr_CA : locale::facet::_S_create_c_locale name not valid
fr_CA.ISO8859-1 : locale::facet::_S_create_c_locale name not valid
Si je change de compilateur de g++ a CC de sun, plus de locale sont
acceptés :
Set locale to C works
common : System does not recognize this locale name
Set locale to en_US.UTF-8 works
Set locale to C works
iso_8859_1 : System does not recognize this locale name
iso_8859_15 : System does not recognize this locale name
Set locale to en_CA works
Set locale to en_CA.ISO8859-1 works
Set locale to en_US works
Set locale to en_US.ISO8859-1 works
Set locale to en_US.ISO8859-15 works
Set locale to en_US.ISO8859-15@euro works
Set locale to fr_CA works
Set locale to fr_CA.ISO8859-1 works
.... Ok pour iso_8859_15, la librarie
/usr/lib/locale/iso_8859_1/iso_8859_15.so.2 n'existe pas,
mais la librairie /usr/lib/locale/iso_8859_1/iso_8859_1.so.2 existes
!!!
Pourquoi y a t il des différences entre les compilateurs ?
Pourquoi un locale n'est pas accepté alors que la librairie existe ?
Y a t il incompatibilité des locale.so avec le compilateur g++ ...
etonant ?
Merci pour votre aide. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|