1

I run several servers, one for development, one for client testing and another for production. I have a character encoding issue (the old "question marks in diamonds" appearing instead of accented characters), but only on one of these servers. The PHP pages are identical on all 3 servers, and the servers are all set up to be as similar as possible (Macports MAMP Mac Minis). Here are the first few lines showing the encoding used:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Biography Generator</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 

There is no database in play, just straight HTML and PHP. Yes, it's obsolete technology. My client makes the encoding and HTML4 decisions, not me. I just have to make this work. What server configuration details might cause this?

3
  • 1
    Can you check if the server is sending content encoding headers like "Content-Type: text/html; charset=UTF-8"? You can view the headers in the browser Developer tools or by opening the page with curl -v ... Commented Jan 14, 2021 at 9:13
  • You can change this with the AddDefaultCharset directive in apache config or .htaccess Commented Jan 14, 2021 at 9:16
  • Thanks, that pointed me in the right direction! Commented Jan 14, 2021 at 21:28

1 Answer 1

0

This turned out to be set in the php.ini file. I had to change:

default_charset = "UTF-8" 

to:

default_charset = "" 

Commenting the line out did not fix it, I had to set it to an empty string.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.