[Mono-list] wrong encoding utf-8 - iso-8859-1

Bernhard schwimmlehrer at gmail.com
Thu Oct 27 12:08:14 EDT 2005


This is what I had to do to get my german pages working:

 <compilation>
   <compilers>
    <compiler language="cs;c#;csharp" extension=".cs" warningLevel="1" 
compilerOptions="/codepage:utf8"
      type="Microsoft.CSharp.CSharpCodeProvider, System, Version=1.0.5000.0, 
Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" 
warningLevel="1" compilerOptions="/codepage:utf8"
      type="Microsoft.VisualBasic.VBCodeProvider, System, 
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   </compilers>
  </compilation>

Mono using Latin as a default encoding. I think there has been some 
discussion to change this to UTF-8.
You could also try something like this in the head of your page:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Best Regards
Bernhard

----- Original Message ----- 
From: <Alois.Flammensboeck at iXTS.de>
To: <mono-list at lists.ximian.com>
Sent: Thursday, October 27, 2005 5:30 PM
Subject: [Mono-list] wrong encoding utf-8 - iso-8859-1


Hello,

after 3 days of unsucessfully work I decided today to write a question to 
this list. I've installed mono 1.1.8 with mod_mono on a linux server. 
Everything works fine but I'm not able to create any ASP.Net pages with 
german special chars.
Here are the steps I'll follow:

1. Create a asp.net page with following content in Borland Delphi 2005 and 
save it in utf-8 format:

<%@ Page Language="c#" Debug="true" Codebehind="WebForm1.pas" 
AutoEventWireup="false" Inherits="WebForm1.TWebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
<title></title>
  </head>
  <body ms_positioning="GridLayout">
<form runat="server">
ä ö ü </form>
  </body>
</html>

2. Compile this webapplication in Delphi 2005

3. upload the WebForm1.aspx and the corresponding assembly

4. Upload the Web.config with the following globalization section:
    <globalization
                                    requestEncoding="utf-8"
responseEncoding="utf-8"
                                    fileEncoding="utf-8"

   />

The resulting page I see in the web browser is:

 ä ö ü

The browser is set to Unicode(utf-8).

If I change the responseEncoding in web.config to "iso-8859-1". The same 
page is shown but the browser is set to Western(iso-8859-1). If I then 
manually change the browsers encoding to Unicode(utf-8) everything is fine.

Does anybody know how to solve this strange problem?

Thanks in advance
Alois


_______________________________________________
Mono-list maillist  -  Mono-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list 



More information about the Mono-list mailing list