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
Share on other sites

First off you've got major HTML errors in this one change things to look like this and it should work.

 

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

Link to comment
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>

 

 

Link to comment
Share on other sites

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'

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.