Yesterday I updated the php version on the local host, and now Russian characters are displayed incorrectly in the forms when selecting the attribute enctype="multipart/form-data" :

(Around 1 is a wrench. Around the size of a broom, the shape of a heart, as well as a heart.

Mb_detect_encoding says that it is utf-8 . Yes, and I myself deduced the values ​​of the $_POST array at the very beginning of the php file, and even then the Russian letters were not displayed correctly, i.e. bd here there is nothing.

When I change the form attribute to application/x-www-form-urlencoded , everything is ok. But I just need multipart/form-data to send files.

I will be glad to any help or alternative.

  • And what's your site in which encoding works? - Visman
  • All in utf-8: headers - header utf-8, meta utf-8 and in htaccess utf8 - andrew
  • Apache changed with php? - Visman
  • no, only php - andrew

1 answer 1

To solve your problem, add an attribute to the form.

 <form ... accept-charset='utf-8' ... 

Or write in .htaccess

 AddDefaultCharset utf-8 

If the site encoding is not utf-8, then replace the value

UPD:

Problem solved by disabling mbstring.encoding_translation : http://ua2.php.net/manual/ru/mbstring.configuration.php#ini.mbstring.encoding-translation

  • both are already spelled out - not to be bothered) literally the other day everything worked, updated the php version and does not work, although there may be no correlation - andrew
  • What version of php? As an option to register: header ("Accept-Charset: utf-8"); - Invision
  • It was 5.3, now 5.4, another xdebug connected. Adding the header header ("Accept-Charset: utf-8") did not change anything. I repeat, when I change to application / x-www-form-urlencoded, everything works fine. - andrew
  • one
  • Thanks, disconnected, earned) can you tell me what's the catch? - andrew