Posted Unicode Characters Displaying as "???"

Discussion in 'ASP .Net' started by =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?=, May 8, 2005.

  1. Hi all:

    I've read through the various related posts in this forum, but without any
    success as yet.

    I've got an ASP.NET application built in VS.NET 2003, and I'm trying to get
    the Armenian Unicode characters I type into the textboxes of my ASPX Web
    pages (via IE6) to post back to the server and get saved in my SQL database
    as Armenian Unicode characters. Not having much luck, though -- all I get
    back are question marks.

    If I manually I insert the Armenian Unicode characters into the database and
    then request them via Web browser, they come out just fine. My Web.config
    file contains the following line:

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

    .... but still no dice. I admit I'm very new to this stuff, so I'm thinking
    perhaps I might have my files saved incorrectly? Again, I'm using Visual
    Studio .NET and I'm located in the US, and I don't believe I've manipulated
    any of the default settings with regard to file encoding or whatnot, so I'm
    stumped.

    (My browser's set to UTF-8, incidentally, and it might be worth noting that
    when I change my fileEncoding attribute to "Unicode" -- just saw it somewhere
    and figured I'd give it a try -- I get an error in Global.asax complaining
    about invalid content.)

    Any help would be hugely appreciated.

    Thanks!
    Chris N.
    MSDN Universal Subscriber
     
    =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?=, May 8, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?=

    Joerg Jooss Guest

    Christian Nunciato wrote:

    > Hi all:
    >
    > I've read through the various related posts in this forum, but
    > without any success as yet.
    >
    > I've got an ASP.NET application built in VS.NET 2003, and I'm trying
    > to get the Armenian Unicode characters I type into the textboxes of
    > my ASPX Web pages (via IE6) to post back to the server and get saved
    > in my SQL database as Armenian Unicode characters. Not having much
    > luck, though -- all I get back are question marks.
    >
    > If I manually I insert the Armenian Unicode characters into the
    > database and then request them via Web browser, they come out just
    > fine. My Web.config file contains the following line:
    >
    > <globalization requestEncoding="utf-8" responseEncoding="utf-8"
    > fileEncoding="utf-8" />


    OK.

    > ... but still no dice. I admit I'm very new to this stuff, so I'm
    > thinking perhaps I might have my files saved incorrectly?


    Just make sure that you really save all your ASP.NET source files in
    UTF-8.

    > Again, I'm using Visual Studio .NET and I'm located in the US, and I
    > don't believe I've manipulated any of the default settings with

    regard
    > to file encoding or whatnot, so I'm stumped.


    If you didn't change the file encoding in VS .NET (UTF-8 is not the
    default encoding in the VS .NET versions I'm aware of), you most likely
    won't be able to display static Armenian text either.

    > (My browser's set to UTF-8, incidentally, and it might be worth
    > noting that when I change my fileEncoding attribute to "Unicode" --
    > just saw it somewhere and figured I'd give it a try -- I get an error
    > in Global.asax complaining about invalid content.)


    Hm... what happens if you allow your browser to pick up the character
    encoding by itself? What browser are you using?

    > Any help would be hugely appreciated.


    Save for the file encoding part (which affects only source files at
    build time) it seems you didn't do anything wrong.

    The first thing I do in case a page's encoding seems to be screwed up
    is to switch between all encodings the browser supports. Once I've
    found out which encoding is actually being used, I trace my way back to
    the culprit from there.

    Cheers,
    --
    http://www.joergjooss.de
    mailto:
     
    Joerg Jooss, May 8, 2005
    #2
    1. Advertising

  3. Have you tried using iso-8859-1 for your encoding ?



    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en Español
    Ven, y hablemos de ASP.NET...
    ======================

    "Christian Nunciato" <> wrote in message
    news:...
    > Hi all:
    >
    > I've read through the various related posts in this forum, but without any
    > success as yet.
    >
    > I've got an ASP.NET application built in VS.NET 2003, and I'm trying to get
    > the Armenian Unicode characters I type into the textboxes of my ASPX Web
    > pages (via IE6) to post back to the server and get saved in my SQL database
    > as Armenian Unicode characters. Not having much luck, though -- all I get
    > back are question marks.
    >
    > If I manually I insert the Armenian Unicode characters into the database and
    > then request them via Web browser, they come out just fine. My Web.config
    > file contains the following line:
    >
    > <globalization requestEncoding="utf-8" responseEncoding="utf-8"
    > fileEncoding="utf-8" />
    >
    > ... but still no dice. I admit I'm very new to this stuff, so I'm thinking
    > perhaps I might have my files saved incorrectly? Again, I'm using Visual
    > Studio .NET and I'm located in the US, and I don't believe I've manipulated
    > any of the default settings with regard to file encoding or whatnot, so I'm
    > stumped.
    >
    > (My browser's set to UTF-8, incidentally, and it might be worth noting that
    > when I change my fileEncoding attribute to "Unicode" -- just saw it somewhere
    > and figured I'd give it a try -- I get an error in Global.asax complaining
    > about invalid content.)
    >
    > Any help would be hugely appreciated.
    >
    > Thanks!
    > Chris N.
    > MSDN Universal Subscriber
     
    Juan T. Llibre, May 8, 2005
    #3
  4. Hi Juan:

    > Have you tried using iso-8859-1 for your encoding ?


    Just tried that, and now my characters seem to be getting posted back as
    escaped HTML characters (%#123;, etc.), which throws a warning on postback.
    Setting the ValidateRequest property of the @Page directive to false lets
    them through as escaped HTML characters.

    Thoughts?

    Chris
     
    =?Utf-8?B?Q2hyaXN0aWFuIE51bmNpYXRv?=, May 8, 2005
    #4
    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. Jonas

    Displaying Unicode characters

    Jonas, Mar 8, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    3,176
    Juan T. Llibre
    Mar 9, 2005
  2. Jay Brahms
    Replies:
    5
    Views:
    1,852
    Anthony Simuel
    Jun 28, 2006
  3. Replies:
    4
    Views:
    960
    Oliver Wong
    Feb 28, 2006
  4. Shankar
    Replies:
    8
    Views:
    13,032
    krassif
    Oct 15, 2009
  5. Grzegorz ¦liwiñski
    Replies:
    2
    Views:
    1,002
    Grzegorz ¦liwiñski
    Jan 19, 2011
Loading...

Share This Page