I have my local MySQL server disabled and see appropriate PDO Exception. The problem is that all cyrillic symbols in the message are broken (message text and cyryllic symbols in path):
PDOException: SQLSTATE[HY000] [2002] ����������� �� �����������, �.�. �������� ��������� ������ ������ �� �����������. in D:\��� �������\domains\time.local\vendor\time\DB.php:25 Stack trace: #0 ...
I've found out that this text is actually in windows-1251 format (shows normal text when I switch to it manually in browser). But I have utf-8 set everywhere: in Apache I have:
AddDefaultCharset utf-8
(Apache sends proper charset header)
All php files are in UTF-8 without BOM. In php.ini I have:
default_charset = "UTF-8"
internal_encoding = "UTF-8"
input_encoding = "UTF-8"
output_encoding = "UTF-8"
So why it still uses windows-1251? And how to switch such messages to utf-8?
I also see that fatal error and other also uses windows-1251. Why?
Apache 2.4/PHP 7.0.3/Windows 10
P. S. My exception handler is quite simple:
set_exception_handler(function (\Throwable $th) {
echo $th;
});