language option in asp program

C

c676228

Hi all,

Sometimes when I get on a Chinese web site, I need to guess the encoding in
order to view the site properly.

Certain times the site will pick up the right encoding automatically. I am
wondering
what we could be done in the program, so the users don't need to guess and
could be able to view the site(not garbled).

If any lanugage file is saved in UTF-8 format, any web browser could view
it, right?
but how come certain time it won't work that way in the IE browser even if
they have UTF-8 installed in their system?
 
A

Anthony Jones

c676228 said:
Hi all,

Sometimes when I get on a Chinese web site, I need to guess the encoding
in
order to view the site properly.

Certain times the site will pick up the right encoding automatically. I am
wondering
what we could be done in the program, so the users don't need to guess and
could be able to view the site(not garbled).

If any lanugage file is saved in UTF-8 format, any web browser could view
it, right?
but how come certain time it won't work that way in the IE browser even if
they have UTF-8 installed in their system?

Ordinarily a UTF-8 file will be marked at the start with what is known as
the BOM (byte-order marker) which can be used to determine that the file is
encoded as UTF-8. However several reasons that may not always be there. IE
can use other heuritics to determine what encoding is being used but its
just guessing.

Its much better if the server provides a charset attribute in the content
type so as to explicitly tell the client its receiving UTF-8.
 
C

c676228

Hi Anthony,

Nice to hear from you again.

If we have already put this in our page:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

And a customer still needs to select utf-8 encoding when he/she is trying to
view the page and one still cannot view the page, what could be the problem?

Thanks,
 
A

Anthony Jones

c676228 said:
Hi Anthony,

Nice to hear from you again.

If we have already put this in our page:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

And a customer still needs to select utf-8 encoding when he/she is trying
to
view the page and one still cannot view the page, what could be the
problem?

Its strange that the client still gets it wrong even with this meta tag
present. If this is an ASP page (which I assume it is because you're
posting here) then I prefer:-

<%@codepage=65001%>
<%Response.CharSet="UTF-8"%>

The meta tag is only designed to emulate the Content-Type header when for
example saved HTML is being loaded from a file system.

Be sure the file is saved as UTF-8 if it contains any static content that is
outside of the standard ASCII characters.

The codepage=65001 directive sets the Response.CodePage to 65001 (the UTF-8
codepage) this ensure all Response.Write calls generate UTF-8 output.

At least then you can be sure the server is generating the correct output.
 
A

Allen Chen [MSFT]

Hi Betty,

Have you solved this issue? If not please tell me the browser version and
send me an html page that can repro this problem. I'm willing to follow up
this issue.

Regards,
Allen Chen
Microsoft Online Support
 
E

Evertjan.

Allen Chen [MSFT] wrote on 03 feb 2009 in
microsoft.public.inetserver.asp.general:
Have you solved this issue? If not please tell me the browser version
and send me an html page that can repro this problem. I'm willing to
follow up this issue.

Dear allen,

Please always quote on usenet,
this is not your and Bill's personal helpdesk.

Browser versions are off topic in a serverside code NG, btw.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top