Posted Unicode Characters Displaying as "???"

G

Guest

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
 
J

Joerg Jooss

Christian said:
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,
 
G

Guest

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
 

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,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top