سؤال

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