Last post Mar 12, 2008 03:59 AM by firstname.lastname@example.org
Mar 06, 2008 07:38 AMemail@example.com|LINK
I'm using Web Deployment Project for VS 2005. I'm using precompliation when I'm building my MSI-package. My problem is that when I publish my code on my web server the precompiled code or text gets wrong encoding. I'm using swedish letters (å,ä,ö) in my
web page, and these letters are translated wrong (for example ? for the letter ä). All text, though, that is dynamically created on the webbserver (for example retrieved from the database) gets right encoding. I'm using US-English OS (Vista), with Location
set to Sweden. Anyone who knows what the issue might be?
Grateful for any answer!
Mar 06, 2008 12:59 PM|hongping|LINK
Perhaps you could try explicitly specifying the file encoding you are using in web.config?
<globalization fileEncoding="utf-8" . . ./>
Mar 07, 2008 04:48 AMfirstname.lastname@example.org|LINK
Ok, i checked the file encoding which is set "iso-8859-1", which should be right, the problem is that the compiler seems to discard this setting (or the settings in the web-config) when pre-compiling the code (I guess it uses the default setting which is
"utf-8" or the OS native settings...which one I'm not sure).
Mar 07, 2008 01:55 PM|hongping|LINK
Are you using Visual Studio to edit your source files (aspx, aspx.cs)? I am not sure how the OS and UI culture affect the file encoding of these source files in VS. It might be the case that they are saved as UTF-8 by default. Open up the file using VS or
notepad, and go to File, Save As. In VS, there is a drop-down box on the Save button to select the encoding.
Your "fileEncoding" attribute should match the file encoding of your souce files. You could try using fileEncoding="UTF-8" to see if it helps.
Mar 10, 2008 03:18 AMemail@example.com|LINK
Yes, I am using Visual Studio. I checked the file encoding and its 'Western Europe - Codepage 1252' so it should be right.
Mar 11, 2008 02:17 PM|hongping|LINK
I just tried the following steps on my machine. My OS is Win2k3 English, but not sure whether that makes any difference.
1. Create new C# web site in VS.
2. In default.aspx, pasted the characters: å,ä,ö
3. Save default.aspx as Western Europe - Codepage 1252.
4. Open default.aspx.cs.
5. Add Response.Write("å,ä,ö"); in Page_Load
6. Save default.aspx.cs as Western Europe - Codepage 1252.
7. In web.config specify <globalization requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" fileEncoding="iso-8859-1" culture="sv-SE" uiCulture="sv-SE"/>
8. Ctrl-F5. I see all 6 charcters.
9. Publish to c:\website1_out . (I tried both updatable and non-updatable with same results)
10. Create IIS virtual directory to point to c:\website1_out
11. Browse the website, I see all 6 characters.
Could you try the above steps in a new web site on your machine to see what happens?
Mar 12, 2008 03:59 AMfirstname.lastname@example.org|LINK
Okey, I didn't try your steps, but I have done the very same thing in Win2k2 English, in another project, and then it works, it's only on Vista (English) i haven't got it to work. Could also mention that my collegue is using Vista (Swedish) and for him its
working on the same project!