language option in asp program

Discussion in 'ASP General' started by c676228, Jan 29, 2009.

  1. c676228

    c676228 Guest

    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
     
    c676228, Jan 29, 2009
    #1
    1. Advertising

  2. "c676228" <> wrote in message
    news:...
    > 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
     
    Anthony Jones, Jan 29, 2009
    #2
    1. Advertising

  3. c676228

    c676228 Guest

    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" <> wrote in message
    > news:...
    > > 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
    >
    >
     
    c676228, Jan 29, 2009
    #3
  4. "c676228" <> wrote in message
    news:...
    > 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
     
    Anthony Jones, Jan 29, 2009
    #4
  5. 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
     
    Allen Chen [MSFT], Feb 3, 2009
    #5
  6. c676228

    Evertjan. Guest

    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)
     
    Evertjan., Feb 3, 2009
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Julien ROUZIERES

    g++ -pg option and -shared option

    Julien ROUZIERES, Dec 21, 2004, in forum: C++
    Replies:
    1
    Views:
    721
    GianGuz
    Dec 21, 2004
  2. Cas
    Replies:
    5
    Views:
    792
    Kevin Jones
    Aug 28, 2006
  3. Kevin Blount

    page.aspx?option - how to detect "option"

    Kevin Blount, Nov 28, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    607
    =?Utf-8?B?RWVyYWo=?=
    Nov 28, 2006
  4. John

    Regex for <option> ... </option>

    John, Jan 23, 2009, in forum: Perl Misc
    Replies:
    10
    Views:
    239
    Eric Pozharski
    Jan 29, 2009
  5. Mark Kolber
    Replies:
    4
    Views:
    348
Loading...

Share This Page