Jump to content

http-equiv="Content-Type" for PHP?


random1

Recommended Posts

Hey All,

 

I have the following simple test page saved as test.php:

 

<body>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<p>test</p>
</body>

 

Each time I load this page and view the page info I get:

 

Content-Type" = text/html; charset=us-ascii

 

But if I instead try:

 

<meta http-equiv="Content-Type" content="utf8" />

 

Content-Type" = utf8

 

Any ideas? Is the server (apache) or PHP install rewriting this?

Link to comment
https://forums.phpfreaks.com/topic/107033-http-equivcontent-type-for-php/
Share on other sites

Try using your title tags inside of your <head> tags this usually fixes that.

 

<title>This is a title</title>

 

EDIT: So now your code will look like this

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  <title>This is a title</title>
  </head>
  <body>
test
  </body>
</html>

 

 

Hi,

 

Just tried:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  <title>This is a title</title>
  </head>
  <body>
test
  </body>
</html>

 

No luck, still says 'us-ascii'

lol nevermind I must have mis-read your post its because your encoding is us-ASCII this can usually be changed in the program you are using under file settings.

 

Not exactly sure which program your using though but the meta tag won't change that information.

 

if your using non-ASCII characters like Japanese then you would be using different file settings.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.