Globalization: Non-English characters

Y

Yuriy Galanter

Hi,

I am trying to display Cyrillic characters on my ASP.NET page. While doing
that on a local server provided by VS.NET - everything looks fine. But when
I publish the site to my ISP host - all the characters are out of whack.
When I saved my ASPX file with encoding (UTF-8, codepage 65001) - Cyrillic
characters look ok on the host, but only those that are static within HTML
code of ASPX file itself or those entered in a TextBox. Anything assigned in
code behind still scrambled. I tried to play around with Session.CodePage
and Response.Charset as well as <globalization> setting in Web.config - to
no avail. Any help is appreciated - how to display both static and
dynamically assigned non-English Characters on an ASP.NET page (and
undependably of the IIS's settings)

Thanks!

Yuriy.
 
B

Bruno Alexandre

I did this, and theres no error in the page view:

just copy/past the hole code to a new aspx file

<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
Label2.Text = "?"
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Test Page</title>
</head>
<body>
<form id="form1" runat="server">
<br />
Static:
<asp:Label ID="Label1" runat="server"
Font-Bold="True">?</asp:Label><br />
<br />
Dynamic:
<asp:Label ID="Label2" runat="server" Font-Bold="True"></asp:Label>
</form>
</body>
</html>
 
J

Joerg Jooss

Thus wrote Yuriy,
Hi,

I am trying to display Cyrillic characters on my ASP.NET page. While
doing that on a local server provided by VS.NET - everything looks
fine. But when I publish the site to my ISP host - all the characters
are out of whack. When I saved my ASPX file with encoding (UTF-8,
codepage 65001) - Cyrillic characters look ok on the host, but only
those that are static within HTML code of ASPX file itself or those
entered in a TextBox. Anything assigned in code behind still
scrambled.

If you're losing characters that are hardcoded in source files (C#, VB.NET),
the language compiler isn't using the correct character encoding when compiling
the source file. Thus, these characters are dropped at compile time. The
easiest way to fix that is to save all source files as UTF-8 with BOM (codepage
65001) as well.

Cheers,
 

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,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top