I have strings with (Swiss) French characters that I would like uppercase (PHP 5.3).
echo strtoupper('société');
Since it strtoupper()does not work with accuentuated characters, I do a setlocale()(this language is available on our Ubuntu dev and debian prod servers), it does not work:
setlocale(LC_CTYPE, 'fr_CH');
echo strtoupper('société');
Expected Result:
SOCIÉTÉ
Result:
SOCIéTé
Available locales:
$ locale -a
...
fr_CH
fr_CH.iso88591
fr_CH.utf8
fr_FR
fr_FR.iso88591
fr_FR.iso885915@euro
fr_FR.utf8
fr_FR@euro
...
$ locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
Note. The module is mbstringunavailable.
Toto source
share