문제

The code is the following:

setlocale( LC_CTYPE, 'ru_RU' );
echo strtoupper('Hello! Привет!');

Latin characters transforming as expected. But Russian - stays unchanged.

Any thoughts?

도움이 되었습니까?

해결책

You want to use mb_strtoupper() instead:

mb_internal_encoding('UTF-8');
setlocale(LC_CTYPE, 'ru_RU');
echo mb_strtoupper('Hello! Привет!');

Output:

HELLO! ПРИВЕТ!

Demo

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top