473,372 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Re: read charset of meta tag

Martin Honnen wrote:
....
On the other hand most browsers by now expose a property like
document.characterSet (Mozilla) or document.charset (IE) which should
give you the charset the browser has taken from the meta or from real
HTTP headers.
Is it true that these metatags have often different values compared to what
the browser actually uses? And the page author might have not a correct idea
of the character set, which the server is sending, thus believing that
putting something to metatags the server obeys him/her. The browsers in this
mess try to conclude the character set by examining the byte stream with
heuristic rules, getting often somewhat correct results.
I thought earlier that metatags are commands to the server: if I put
ISO-8859-10 to the tag, then the server transforms the page to that
characterset!

Eg javascript files on the server: I suspect most authors here have not 100
% reliable and true info which characterset they have. At least I have not
:)
Aug 28 '08 #1
1 1483
optimistx wrote:
Martin Honnen wrote:
...
>On the other hand most browsers by now expose a property
like document.characterSet (Mozilla) or document.charset
(IE) which should give you the charset the browser has
taken from the meta or from real HTTP headers.

Is it true that these metatags have often different values
compared to what the browser actually uses?
That is certainly possible as that browser will follow the HTTP headers
and take any character set declarations in the headers in preference to
anything else (as it required in HTTP). And it is certainly common for
the attributes of META elements to be at odds with HTTP headers (and
even at odds with document mark-up; how often do you see XHTML mark-up
contain a META element that attempts to assert that document to be
textt/html?).
And the page author might have not a correct idea of the
character set, which the server is sending, thus believing
that putting something to metatags the server obeys him/her.
Yes, misconceptions about web technologies are rife.
The browsers in this mess try to conclude the character set
by examining the byte stream with heuristic rules,
That has been observed (particularly with IE (at least up until 6)).
getting often somewhat correct results.
And some spectacularly wrong result, hence the observation of the
phenomenon.
I thought earlier that metatags are commands to the server:
For some servers they have been; the server would process the document
prior to sending and base the headers used on the META elements. But
that is not very common with servers.
if I put ISO-8859-10 to the tag, then the server transforms
the page to that characterset!

Eg javascript files on the server: I suspect most authors here
have not 100 % reliable and true info which characterset they
have.
Observing that some people don't know what they are doing is no reason
to assume 'most here' do not.
At least I have not
:)
Get yourself a web debugging proxy (Fiddler or Charles) or some other
tool that can show you the HTTP headers.

Richard.

Aug 28 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: CJ Oxx | last post by:
I have a problem with browser charset recognition when using PHP 4.1.2 (this is the PHP version which our hosting company provides). For charset recognition, I use the following meta-tag: <meta...
1
by: David Thomas | last post by:
Hi there, a while ago, I posted a question regarding reading japanese text from a text file. Well, since I solved the problem, I thought I'd post my solution for the benefit of other people with...
4
by: see_mun_lee | last post by:
I use asp to develop a web page to read an excel file containing Chinese Character then display it in the web page. Unfortunately, I cant display it!!! it will display (?????????). <META...
1
by: Nick Kew | last post by:
Someone just drew attention to an open bug report in Apache concerning shipping with an AddDefaultCharset set by default in httpd.conf. This leads to bogus charsets being served in many cases. ...
2
by: Reply Via Newsgroup | last post by:
Folks, I'm pretty sure it can be done, and I'm doing pretty good with my javascript so I'm pretty sure I just need a quick point in the right direction... If my web page is referenced in the...
28
by: Xiaotian Sun | last post by:
I added the following line to the header of my html file <meta http-equiv="content-type" content="text/html; charset=utf-8"> hoping browsers will use UTF-8 encoding. But all browsers I tried...
4
by: Rémi | last post by:
Question: How can you determine the character set used by a webpage you built? My understanding of the issue is that the character set used by an HTML file (or any other file, for that matter)...
7
by: gmclee | last post by:
Hi there, I am writing a program to load HTML from file and send it to IE directly. I've met some problem in charset setting. Most of HTML have charset "us-ascii", for some reason, some UNICODE...
2
by: vunet.us | last post by:
I translate my website to German and some ASCII characters are not translated by my browser. For example I see this: &#x00FC; I use charset: <meta http-equiv="Content-Type" content="text/html;...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.