HTMLENTITIES不适用于西里尔字母

How can I make htmlentities to work with cyrillic symbols. Now, when I try input some cyrillic: "Тест" it returns "ТеÑ" My code: $var = htmlentities($var); Encoding: utf-8. Thanks!

In order to bring closure to this question -

I want my users not to enter HTML code in their comments

This is not necessary; htmlspecialchars() will convert all special characters necessary to prevent HTML from being shown.

I had the same problem, try this solution:

<?php echo htmlentities("Текст на русском языке", ENT_QUOTES, 'UTF-8') ?>