0

When I post a string via GET or POST with smart-quotes and echo the posted string, the smart-quote renders two black diamond question marks on one server, but ’ on another server. The server with ’ is okay, because it will eventually render as the correct UTF8 character, but the two black diamonds seems to mean that the character is no longer recognized. Any suggestions on how to identify why this is happening? The bad reaction is happening on an Apache server running PHP. No database is involved.

moluv00
  • 374
  • 2
  • 7
  • Check out this StackOverflow post: http://stackoverflow.com/questions/6087309/can-i-use-iconv-to-convert-multi-byte-smart-quotes-to-extended-ascii-smart-quote – MonkeyZeus Oct 11 '13 at 20:13
  • Once the character turns into black diamonds it can't be translated, which is what the above post is about. I'm trying to debug my server setup, so that I can eventually perform the translation to smart quotes, which is no longer doable after a form post/get. – moluv00 Oct 11 '13 at 20:36
  • It could be a source issue as well. If the html form sending the POST is on a page which is not encoded with UTF-8 then the transmission is screwed up. How is the POST/GET reaching your server: CURL, html form, AJAX, direct url visit? – MonkeyZeus Oct 11 '13 at 20:39
  • Are you doing either `` **or** `header('Content-Type: text/html; charset=utf-8');` of the HTML page that may be POSTing the data? – MonkeyZeus Oct 11 '13 at 20:41
  • I have the same form on two servers. Both html files have the following line: . One server returns an encoded character, and one returns a bogus one. – moluv00 Oct 11 '13 at 20:54
  • I cannot say I have ever encountered this before. I will let you know if I find any useful information. Until then, good luck! – MonkeyZeus Oct 11 '13 at 21:00
  • Sufficient additional data, including code sample to reproduce the issue, should be included in the question itself. – Jukka K. Korpela Oct 11 '13 at 21:47
  • Thanks for the suggestions MonkeyZeus – moluv00 Oct 11 '13 at 22:11
  • This link also has some good suggestions on the subject: http://blog.salientdigital.com/2009/06/06/special-characters-showing-up-as-a-question-mark-inside-of-a-black-diamond/ – moluv00 Oct 11 '13 at 22:30

1 Answers1

0

Our server administrator commented out the following line in the php.ini file:

mbstring.http_input = auto

This configuration was commented out in the server that behaved correctly, and solved the problem on the second server. Go figure.

I hope this answer helps someone else.

moluv00
  • 374
  • 2
  • 7