Force Character Encoding

  • Thread starter Thread starter Karl E. Peterson
  • Start date Start date
K

Karl E. Peterson

Hi --

Okay, so how does one go about forcing character encoding? I thought
that by having this in the <head> section:

<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">

That a browser would automatically choose to use ISO-8859-1, but for
some inexplicable reason I've seen pages lately where both Firefox and
IE8 choose to use Unicode instead.

These are just pretty straight-up ASP pages, with this as the very
first line:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

They're full of the diamond-question mark char, though. Ideas?

Thanks... Karl
 
I thought that I read somewhere in this or another NG that the server
decides what character code to use. But I am sure that someone with more
knowledge than I will reply
 
It not the webpage!
it is your Firefox and IE8 set to Unicode!

http://en.wikipedia.org/wiki/Character_encodingISO-8859-1 <<<<< Character
encoding translation and
<<<< See also Windows code page - various character set encodings used by
Microsoft Windows>>>>
<<<http://en.wikipedia.org/wiki/Windows_code_page


ISO 8859-1 Western Europe
ISO 8859-2 Western and Central Europe
ISO 8859-3 Western Europe and South European ( Turkish, Maltese plus
Esperanto )
ISO 8859-4 Western Europe and Baltic countries ( Lithuania, Estonia and
Lapp )

And can do
MS-Windows character sets:
Windows-1252 for Western languages
<meta http-equiv="Content-Type" content="text/html;charset=Windows-1252">
 
As Trevor said, if the server sends an HTTP header that sets the character
encoding, the browser will use that encoding rather than the meta tag
version.

--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp

Reply only to group - emails will be deleted unread.
 
Trevor Lawrence explained on 1/6/2010 :
I thought that I read somewhere in this or another NG that the server decides
what character code to use. But I am sure that someone with more knowledge
than I will reply

Y'know, now that you say that, that does sound familiar. And I'm
seeing *identical* pages coming from different servers behaving
differently. I gotta pursue that angle. Thanks!
 
Hot-text wrote on 1/6/2010 :
It not the webpage!
it is your Firefox and IE8 set to Unicode!

Do those browsers remember what setting to use for each page and/or
server? If not, then this isn't the case. Same page, different
servers, different results.
 
Ronx was thinking very hard :
As Trevor said, if the server sends an HTTP header that sets the character
encoding, the browser will use that encoding rather than the meta tag
version.

That was it! Trevor nailed it. I just looked at the MIME Types on
both servers, and on the public (isn't that always the case?) box I
had:

..asp text/html;charset=utf-8
..htm text/html;charset=iso-8859-1

Where as the internal box left them both undefined. <groan>

So, is there a lesson here? Assuming a guy actually goes to the
trouble of putting the metatag in there, isn't it smarter then to
remove the MIME definition? Thoughts, anyone?

Thanks!
 
Karl E. Peterson submitted this idea :
Trevor Lawrence explained on 1/6/2010 :

Y'know, now that you say that, that does sound familiar. And I'm seeing
*identical* pages coming from different servers behaving differently. I
gotta pursue that angle. Thanks!

Stuck it! It was MIME type definitions on one of the servers. Thanks!
 
""""""YES""""""
Message Character Set Conflict
Is the Message

Send As Unicode
Or
Send AS IS ?

? ??? ??? watashi I, me >>> is Unicode here and
will be Unicode in a webpage to you all you see is <<<I, me >>>>>
For all the same word ,,,BUT NOT THE SOME TEXT____
FOR_THE_TEXT_IS_UNICODE


Arabic numerals (black)):

???????????????1?m?????? <<< TEXT UNICODE if it was in
The same headline, transliterated to the Latin alphabet:

Radokurifu, Marason gorin daihyo ni ichi-man metoru shutsujo ni mo fukumi
<<< TEXT UNICODE


<META http-equiv=Content-Type content="text/html; charset=windows-1252">
CODE ascharset=windows-1252 HERE >>>>>> &nbsp; ,,,,,&lt;&lt;&lt;
ラドクリフ、マラソン五輪代表に1万m出場にも含み


But are we Talking browsers Or HTML ?
 
""""""YES""""""Send AS IS

Message Character Set Conflict

This Is the Message

Send As Unicode <<<<<<<,


ç§ ã‚ãŸã— ワタシ watashi I, me >>> is Unicode here and
will be Unicode in a webpage to you all you see is <<<I, me >>>>>
For all the same word ,,,BUT NOT THE SOME TEXT____
FOR_THE_TEXT_IS_UNICODE


Arabic numerals (black)):

ラドクリフã€ãƒžãƒ©ã‚½ãƒ³äº”輪代表ã«1万m出場ã«ã‚‚å«ã¿ <<< TEXT UNICODE if it was in
The same headline, transliterated to the Latin alphabet:

Radokurifu, Marason gorin daihyŠni ichi-man mētoru shutsujŠni mo fukumi
<<< TEXT UNICODE


<META http-equiv=Content-Type content="text/html; charset=windows-1252">
CODE ascharset=windows-1252 HERE >>>>>> &nbsp; ,,,,,&lt;&lt;&lt;
ラドクリフ、マラソン五輪代表に1万m出場にも含み


But are we Talking browsers Or HTML ?
 
Back
Top