0

I have a problem that in my production server all text in the post requests that contains non standard ascii characters are corrupted while the encoding is utf-8. On my development server the text is displayed fine.

print(mb_detect_encoding($_POST["text"]));
print($_POST["text"]);

Output is: utf-8 Ã?Ã?Ã? Ã?Ã?Ã? Ã?Ã?Ã?

while input is ÅÅÅ ÄÄÄ ÖÖÖ

I use <meta charset="UTF-8"> in the head and accept-charset="UTF-8" in the form.

<form id="announcement_form" method="post" action="php/announcment_bar.php" accept-charset="UTF-8">

Olof
  • 776
  • 2
  • 14
  • 33

1 Answers1

0

From the link given to me by Obsidian Age the problem was that in the php.ini the default_charset. Since 5.6+ the default value of default_charset is set to UTF-8. That is the reason why it worked on my development server. However since out production server was older and installed before 5.6 it used the old default value which is none/commented out.

Community
  • 1
  • 1
Olof
  • 776
  • 2
  • 14
  • 33