473,804 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Which charset to use?

In the <meta http-equiv="Content-Type" content="text/html;
charset=??????? ?"> tag, what is the best charset to use? I tend to use
UTF-8, for no reason other than it sounds much cooler than iso-8859-1 etc
etc... Are there any guidelines for this sort of thing?

P.
Jul 20 '05 #1
30 20296
"The Plankmeister" <pl************ ******@hotmail. com> wrote:
In the <meta http-equiv="Content-Type" content="text/html;
charset=??????? ?"> tag, what is the best charset to use? I tend to use
UTF-8, for no reason other than it sounds much cooler than iso-8859-1 etc
etc... Are there any guidelines for this sort of thing?


We had this discussion just a few days ago:
news:o6******** *************** *********@4ax.c om
http://groups.google.com/groups?th=375726c4206f6e49
Maybe you read this first?
Jul 20 '05 #2
So basically, it's dependant on the situation, and it's down to a two horse
race between UTF-8 and iso-8859-1?
From what I can gather, iso-8859-1 is the best all rounder because it
intrinsically has certain characters, whereas to obtain the same characters
in UTF-8, you need to use entity codes?

I think I'll make the switch to iso-8859-1 and see how it goes...

Thanks for the link :)

P.
"Andreas Prilop" <nh******@rrz n-user.uni-hannover.de> wrote in message
news:0909200321 57072296%nh**** **@rrzn-user.uni-hannover.de...
"The Plankmeister" <pl************ ******@hotmail. com> wrote:
In the <meta http-equiv="Content-Type" content="text/html;
charset=??????? ?"> tag, what is the best charset to use? I tend to use
UTF-8, for no reason other than it sounds much cooler than iso-8859-1 etc etc... Are there any guidelines for this sort of thing?


We had this discussion just a few days ago:
news:o6******** *************** *********@4ax.c om
http://groups.google.com/groups?th=375726c4206f6e49
Maybe you read this first?

Jul 20 '05 #3
The Plankmeister wrote:
In the <meta http-equiv="Content-Type" content="text/html;
charset=??????? ?"> tag


You server should be sending that information, rather than using a meta
hack.

--

Mark Parnell
http://www.clarkecomputers.com.au
Jul 20 '05 #4
The Plankmeister wrote:
In the <meta http-equiv="Content-Type" content="text/html;
charset=??????? ?"> tag, what is the best charset to use?


This should be in the Content-Type: header, not in the document itself.
Aside from that, you should use the one that best matches the document.
Jul 20 '05 #5
The Plankmeister wrote:
In the <meta http-equiv="Content-Type" content="text/html;
charset=??????? ?"> tag, what is the best charset to use? I tend to use
UTF-8, for no reason other than it sounds much cooler than iso-8859-1 etc
etc... Are there any guidelines for this sort of thing?


The above-noted "meta" tag is merely a cheap plastic substitute for
sending a proper charset attribute in the actual server-supplied HTTP
headers.

You should use a charset attribute that actually reflects the encoding
of the data you're sending, not just one that "sounds cool".

Some info on character sets/encodings:
http://webtips.dan.info/char.html
http://mailformat.dan.info/body/charsets.html

--
== Dan ==
Dan's Mail Format Site: http://mailformat.dan.info/
Dan's Web Tips: http://webtips.dan.info/
Dan's Domain Site: http://domains.dan.info/

Jul 20 '05 #6
In article <3f************ ***********@dre ad14.news.tele. dk> in
comp.infosystem s.www.authoring.html, The Plankmeister
<pl************ ******@hotmail. com> wrote:
So basically, it's dependant on the situation, and it's down to a two horse
race between UTF-8 and iso-8859-1?
From what I can gather, iso-8859-1 is the best all rounder because it
intrinsicall y has certain characters, whereas to obtain the same characters
in UTF-8, you need to use entity codes?

I think I'll make the switch to iso-8859-1 and see how it goes...


Please don't post upside down.

Putting the charset in a <meta> tag in the document is a second-
choice technique. Far better that it should be provided a one of the
HTTP headers, which the browser sees before it begins parsing the
document.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #7
So I guess it's not possible to modify the charset then? Unless you change
the httpd.conf file (or whatever http server you happen to be running's
config files) In which case, if you have absolutely no control over the
charset the server is using, I guess there's no point in worrying about it?

P.

"Owen Jacobson" <oj************ **@mx-deus.net> wrote in message
news:H2******** ***********@new s20.bellglobal. com...
The Plankmeister wrote:
In the <meta http-equiv="Content-Type" content="text/html;
charset=??????? ?"> tag, what is the best charset to use?


This should be in the Content-Type: header, not in the document itself.
Aside from that, you should use the one that best matches the document.

Jul 20 '05 #8
"The Plankmeister" <pl************ ******@hotmail. com> wrote in
news:3f******** *************** @dread16.news.t ele.dk:
So I guess it's not possible to modify the charset then? Unless you
change the httpd.conf file (or whatever http server you happen to be
running's config files) In which case, if you have absolutely no
control over the charset the server is using, I guess there's no point
in worrying about it?


going by my knowledge of IIS, hope it applies/provides insight to
others....

The web server itself does not know what a charset is, it merely outputs
bytes.

If you want to stream HTML files in a certain charset, you have to save in
that charset (ie pre-convert your page to another character set). Eg, if
you want to serve a page in Big5, you have to create a file that looks
something like this:

活動規划

which is raw UTF8. Multi-byte charsets like UTF8 represent a single
character with a series of 1 or more bytes.

Sorry, I don't know how to change the headers on individual files in Apache
to modify the Content-Type.. but it would be like

Content-Type: text/html charset="UTF8"
Jul 20 '05 #9
"The Plankmeister" <pl************ ******@hotmail. com> wrote:
So I guess it's not possible to modify the charset then? Unless you
change the httpd.conf file (or whatever http server you happen to be
running's config files) In which case, if you have absolutely no
control over the charset the server is using, I guess there's no point
in worrying about it?
If it's a Apache server, you should be able to create a .htaccess
file in the same directory as your web pages and use it to specify
a custom Content-Type and charset.

http://apache-server.com/tutorials/A...-htaccess.html

If it's an IIS server, and it supports ASP pages, you could use the
command SetContentType( "text/html; charset=whateve r") in your page.

;K

Jul 20 '05 #10

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

Similar topics

34
2798
by: nose | last post by:
Hi, A little poll for the week-end: Which charset do you use for your website(s): utf-8? iso-8859-1 (...)? other? just don't care? What charset is better now, say, for European languages like french, german, spanish...
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10352
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10097
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7642
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.