>>> Here is a link to >>> http://coderie.ac-mb.info/english.php?article=phppoll#i18n a page I >>> wrote a >>> while ago , where there are a few hints about locale. >> >> Thanks. Will take a look. > > Aha! setlocale(LC_ALL, 'es') returns false (and the server is Linux). My > test program: > > <?php > $locale = var_export(setlocale(LC_ALL, 'es'), true); > echo "Locale: $locale<br/>"; > ?> > > The output is 'Locale: false'. > > What should I say to my web host company? I'm not sure I know enough to > articulate the problem (other than "it doesn't work"). The server is > running Linux. What does the web host have to do to make the locales I > want "available"?
Depends on used distribution. On Debian locales are controlled with 'dpkg-reconfigure locales'. If you want the hard way, ask them to run 'localedef -i es_ES -f UTF-8 es_ES.UTF-8' and restart web service. They will have to rerun same command after every glibc upgrade. You will have to use 'setlocale(LC_ALL,'es_ES.UTF-8')' in PHP. Maybe there are other Spanish system locales. If you have PHP 4.3 or later, run other test script ---- <?php $aLocales = array('es_ES.UTF-8', 'es_ES.UTF8', 'es_ES.ISO-8859-1', 'es_ES.ISO8859-1', 'es_ES.ISO-8859-15', 'es_ES.ISO8859-15', 'es_ES', '[EMAIL PROTECTED]', 'es'); var_dump(setlocale(LC_ALL,$aLocales)); ---- Or use php-gettext classes (http://savannah.nongnu.org/projects/php-gettext/) instead of gettext extension. -- Tomas -- PHP Unicode & I18N Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php