Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > language option in asp program

Reply
Thread Tools

language option in asp program

 
 
c676228
Guest
Posts: n/a
 
      01-29-2009
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?
--
Betty
 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      01-29-2009
"c676228" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.


--
Anthony Jones - MVP ASP/ASP.NET

 
Reply With Quote
 
 
 
 
c676228
Guest
Posts: n/a
 
      01-29-2009
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,
--
Betty


"Anthony Jones" wrote:

> "c676228" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.
>
>
> --
> Anthony Jones - MVP ASP/ASP.NET
>
>

 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      01-29-2009

"c676228" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.


--
Anthony Jones - MVP ASP/ASP.NET

 
Reply With Quote
 
Allen Chen [MSFT]
Guest
Posts: n/a
 
      02-03-2009
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

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-03-2009
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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex for <option> ... </option> John Perl Misc 10 01-29-2009 11:04 PM
page.aspx?option - how to detect "option" Kevin Blount ASP .Net 6 11-28-2006 09:21 PM
DHCP relay agent versus Option 3; Routers Option lcorrigan Cisco 2 09-27-2006 05:18 PM
no 'option' in aspx file means 'option'="false"? Cas ASP .Net 5 08-28-2006 10:36 AM
g++ -pg option and -shared option Julien ROUZIERES C++ 1 12-21-2004 02:30 PM



Advertisments