473,378 Members | 1,623 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,378 software developers and data experts.

confused over utf-8 encoding

I wish my aspx pages to be interpreted as UTF-8 by browsers.

Apart from setting the following in the web.config file:

<globalization fileEncoding="utf-8" requestEncoding="utf-8"
responseEncoding="utf-8" />

1. Do I also have to specify <meta http-equiv="Content-Type"
content="text/html; charset=utf-8"in every aspx page?

2. Or also specify utf-8 in the page directive of every page?

In short, I am a bit worried that when I see the source of my generated
aspx pages I see no meta information regarding the encoding. Should I
also be adding this into every page or is it not necessary as long as
it's specified in web.config?

Dec 11 '06 #1
4 1549
Hi,

Steve wrote:
I wish my aspx pages to be interpreted as UTF-8 by browsers.

Apart from setting the following in the web.config file:

<globalization fileEncoding="utf-8" requestEncoding="utf-8"
responseEncoding="utf-8" />

1. Do I also have to specify <meta http-equiv="Content-Type"
content="text/html; charset=utf-8"in every aspx page?
It is not necessary. Setting the encoding in the configuration file adds
the specified information to the request. Using META is useful if you
don't have access to the request's header, but if you use server-side
code, it's better to use the request's header directly.
2. Or also specify utf-8 in the page directive of every page?
If you want the setting to be valid for each page in your application,
use the configuration file.

If you want to specify something different for a given page, use the
Page directive.

This is valid for every setting, not only encoding.
In short, I am a bit worried that when I see the source of my generated
aspx pages I see no meta information regarding the encoding. Should I
also be adding this into every page or is it not necessary as long as
it's specified in web.config?
To check that this is working, check "Auto-select" in View / Encoding in
IE. Then load your page. Then check what the browser uses in View /
Encoding. It should be UTF8 (which is not the default).

Also, you can use Fiddler to check the Request header.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Dec 11 '06 #2
Merci beaucoup Laurent!

That really put my mind at rest.

Thanks, Steve.
Laurent Bugnion wrote:
Hi,

Steve wrote:
I wish my aspx pages to be interpreted as UTF-8 by browsers.

Apart from setting the following in the web.config file:

<globalization fileEncoding="utf-8" requestEncoding="utf-8"
responseEncoding="utf-8" />

1. Do I also have to specify <meta http-equiv="Content-Type"
content="text/html; charset=utf-8"in every aspx page?

It is not necessary. Setting the encoding in the configuration file adds
the specified information to the request. Using META is useful if you
don't have access to the request's header, but if you use server-side
code, it's better to use the request's header directly.
2. Or also specify utf-8 in the page directive of every page?

If you want the setting to be valid for each page in your application,
use the configuration file.

If you want to specify something different for a given page, use the
Page directive.

This is valid for every setting, not only encoding.
In short, I am a bit worried that when I see the source of my generated
aspx pages I see no meta information regarding the encoding. Should I
also be adding this into every page or is it not necessary as long as
it's specified in web.config?

To check that this is working, check "Auto-select" in View / Encoding in
IE. Then load your page. Then check what the browser uses in View /
Encoding. It should be UTF8 (which is not the default).

Also, you can use Fiddler to check the Request header.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Dec 11 '06 #3
Adding to Laurent's correct on-target explanation, you should grab yourself
a copy of ieHTTPHeaders, which shows you all the HTTP headers
included in the page you're displaying.

http://www.blunck.se/iehttpheaders/iehttpheaders.html

It's free...and very useful to verify whether any header is included in any page.

You turn it on, or off, after you install it,
by selecting "View", "Explorer Bar", "ieHttpHeaders" in IE.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Steve" <ba****@iranmania.comwrote in message
news:11**********************@73g2000cwn.googlegro ups.com...
Merci beaucoup Laurent!

That really put my mind at rest.

Thanks, Steve.
Laurent Bugnion wrote:
>Hi,

Steve wrote:
I wish my aspx pages to be interpreted as UTF-8 by browsers.

Apart from setting the following in the web.config file:

<globalization fileEncoding="utf-8" requestEncoding="utf-8"
responseEncoding="utf-8" />

1. Do I also have to specify <meta http-equiv="Content-Type"
content="text/html; charset=utf-8"in every aspx page?

It is not necessary. Setting the encoding in the configuration file adds
the specified information to the request. Using META is useful if you
don't have access to the request's header, but if you use server-side
code, it's better to use the request's header directly.
2. Or also specify utf-8 in the page directive of every page?

If you want the setting to be valid for each page in your application,
use the configuration file.

If you want to specify something different for a given page, use the
Page directive.

This is valid for every setting, not only encoding.
In short, I am a bit worried that when I see the source of my generated
aspx pages I see no meta information regarding the encoding. Should I
also be adding this into every page or is it not necessary as long as
it's specified in web.config?

To check that this is working, check "Auto-select" in View / Encoding in
IE. Then load your page. Then check what the browser uses in View /
Encoding. It should be UTF8 (which is not the default).

Also, you can use Fiddler to check the Request header.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch

Dec 11 '06 #4
Thanks for that Juan. Will install it now.

Steve
Juan T. Llibre wrote:
Adding to Laurent's correct on-target explanation, you should grab yourself
a copy of ieHTTPHeaders, which shows you all the HTTP headers
included in the page you're displaying.

http://www.blunck.se/iehttpheaders/iehttpheaders.html

It's free...and very useful to verify whether any header is included in any page.

You turn it on, or off, after you install it,
by selecting "View", "Explorer Bar", "ieHttpHeaders" in IE.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Steve" <ba****@iranmania.comwrote in message
news:11**********************@73g2000cwn.googlegro ups.com...
Merci beaucoup Laurent!

That really put my mind at rest.

Thanks, Steve.
Laurent Bugnion wrote:
Hi,

Steve wrote:
I wish my aspx pages to be interpreted as UTF-8 by browsers.

Apart from setting the following in the web.config file:

<globalization fileEncoding="utf-8" requestEncoding="utf-8"
responseEncoding="utf-8" />

1. Do I also have to specify <meta http-equiv="Content-Type"
content="text/html; charset=utf-8"in every aspx page?

It is not necessary. Setting the encoding in the configuration file adds
the specified information to the request. Using META is useful if you
don't have access to the request's header, but if you use server-side
code, it's better to use the request's header directly.

2. Or also specify utf-8 in the page directive of every page?

If you want the setting to be valid for each page in your application,
use the configuration file.

If you want to specify something different for a given page, use the
Page directive.

This is valid for every setting, not only encoding.

In short, I am a bit worried that when I see the source of my generated
aspx pages I see no meta information regarding the encoding. Should I
also be adding this into every page or is it not necessary as long as
it's specified in web.config?

To check that this is working, check "Auto-select" in View / Encoding in
IE. Then load your page. Then check what the browser uses in View /
Encoding. It should be UTF8 (which is not the default).

Also, you can use Fiddler to check the Request header.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Dec 12 '06 #5

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

Similar topics

11
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
38
by: Haines Brown | last post by:
I'm having trouble finding the character entity for the French abbreviation for "number" (capital N followed by a small supercript o, period). My references are not listing it. Where would I...
1
by: Benny Ng | last post by:
Hi,All, Export Method: ------------------------------------------------------------------------- strFileNameExport = "Results" Response.Clear() Response.Buffer = True...
7
by: Jimmy Shaw | last post by:
Hi everybody, Is there any SIMPLE way to convert from UTF-16 to UTF-32? I may be mixed up, but is it possible that all UTF-16 "code points" that are 16 bits long appear just the same in UTF-32,...
8
by: YYZ | last post by:
I'm using asp, not asp.net. I've got some open ended questions that I was really hoping someone in here could answer, or direct me to some resources that will help me answer them on my own. ...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.