Trying to make my first ASP.NET page. Got IIS 5.1 in XP, configured to run .NET 4. Created a new virtual directory and added the .aspx file. When I view the file, non-ASCII characters are corrupted. For example, รผ (U + 00FC) is converted to รยผ (U + 00C3 U + 00BC), which is equivalent to I-not-get-this-is-UTF-8.
I tried various ways to use this:
Finally, I found two ways to work:
- Replacing non-ASCII characters with symbolic links such as
üThis was normal in the 90s, not today. Adding the web.config file to the virtual directory with this content:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<globalization fileEncoding="utf-8"/>
</system.web>
</configuration>
Without a parameter fileEncoding, the ASP.NET parser will read .aspx and corrupt every character without ASCII characters, without trying to infer the encoding of the file. Is this something that you, professionals, have learned to live, or am I missing something? Is the globalization web.config file a way to handle "international" characters on .aspx pages? I donโt remember that I had similar problems with PHP, so I am puzzled why this is due to ASP.NET.
source
share