Using Fedora Core 8 with Mono repository from opensuse.org for Fedora 8.
Maybe this has been answered before, but could not find any references.
I have this problem with the test ASPX file attached, with the
Web.config file. The ASPX file has non-ASCII characters (utf-8 encoded)
as part of the HTML content in the file. When I serve this file with
mod-mono-server or with xsp2, the characters are displayed correctly.
If, however, I try to serve it with mod-mono-server2, the characters
corresponding to the utf-8 encoding are rendered as question marks. I
have checked with telnet that the server does specify utf-8 as encoding:
[EMAIL PROTECTED] public_html]$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /~alex/TestODBC.aspx HTTP/1.1
Host: localhost
Connection: close
HTTP/1.1 200 OK
Date: Sat, 17 May 2008 16:34:36 GMT
Server: Apache/2.2.8 (Fedora)
Content-Length: 2143
Cache-Control: private
Set-Cookie: ASP.NET_SessionId=011364A41760ECF8497F5AC2; path=/~alex
Connection: close
Content-Type: text/html; charset=utf-8
However, the response itself shows question marks instead of the bytes
corresponding to the proper encoding:
<span id="lblPeticion">Petici??n SQL:</span></td>
This should read "Petición" with an accented letter o .
If I had to guess, I would say that the encoding gets garbled by a
superfluous conversion to ASCIIEncoding after being generated correctly
as UTF-8.
Could any of you please confirm whether this happens to you?
--
perl -e '$x=2.4;print sprintf("%.0f + %.0f = %.0f\n",$x,$x,$x+$x);'
<%@ Page Language="C#" compilerOptions="/codepage:utf8" Debug="true"
ClassName="PruebaODBC" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<%@ import Namespace="System.Data.Odbc" %>
<script runat="server">
void btnEjecutar_Click(object sender, EventArgs e)
{
OdbcConnection oConn;
OdbcCommand oCommand;
OdbcDataAdapter oDataAdapter;
OdbcDataReader oReader;
lblPeticionEjecutada.Text = txtPeticionSQL.Text;
oConn = new OdbcConnection(txtDSN.Text);
oConn.Open();
oDataAdapter = new OdbcDataAdapter();
oCommand = new OdbcCommand(txtPeticionSQL.Text, oConn);
oReader = oCommand.ExecuteReader();
dgrMysqlVar.DataSource = oReader;
dgrMysqlVar.DataBind();
oConn.Close();
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<table style="WIDTH: 515px; HEIGHT: 102px">
<tbody>
<tr>
<td>
<p>
<asp:Label id="lblDSN" runat="server">DSN de
datos:</asp:Label>
</p>
</td>
<td>
<asp:TextBox id="txtDSN" runat="server"
Width="392px">Driver={MySQL ODBC 3.51
Driver};user=test;password=test;</asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label id="lblPeticion"
runat="server">Petición SQL:</asp:Label></td>
<td>
<p>
<asp:TextBox id="txtPeticionSQL" runat="server"
Width="394px"></asp:TextBox>
</p>
</td>
</tr>
<tr>
<td colspan="2">
<p align="center">
<asp:Button id="btnEjecutar"
onclick="btnEjecutar_Click" runat="server" Text="Ejecutar"></asp:Button>
</p>
</td>
</tr>
</tbody>
</table>
<p>
</p>
<p>
<asp:Label id="lblPeticionEj" runat="server">Resultados para
petición:</asp:Label> <asp:Label id="lblPeticionEjecutada"
runat="server"></asp:Label>
</p>
<p>
<asp:DataGrid id="dgrMysqlVar" runat="server" Width="362px"
Height="61px"></asp:DataGrid>
</p>
<!-- Insert content here -->
</form>
</body>
</html>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<globalization requestEncoding="utf-8"
responseEncoding="utf-8"
fileEncoding="utf-8"
responseHeaderEncoding="utf-8"
culture="auto:es-EC"
uiCulture="auto:es-EC" />
</system.web>
</configuration>
_______________________________________________
Mono-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list