Web Deployment Project and encoding RRS feed

  • Question

  • User1810020239 posted
    Hello, WDP is a very helpful add-in and I appreciate its developers for rolling it out. I have a problem though with encoding after the project is deployed. My websites use Windows-1251 encoding - <globalization requestEncoding="windows-1251" responseEncoding="windows-1251"/> And when the site is deployed all my text content becomes unreadable. Is there any way of fixing this? (I can't switch to UTF8) Thank you.
    Friday, March 10, 2006 6:39 AM

All replies

  • User-1363174918 posted
    Which language your pages are in? Which default OS code page on your machine and what is default code page on the target server?
    Friday, March 10, 2006 6:37 PM
  • User1810020239 posted
    It's in russian. Windows-1251 on my machine and on the server. You can look at the page here - http://proprint.ru Alex
    Saturday, March 11, 2006 7:12 AM
  • User831698009 posted

    I have the same issue with WDP.

    Mikhail , what do you mean by language of the page? I set language on the (single) masterpage involved, and also on the derived ones, but still the page isn't displayed correctly. The problem seems to be that WDP doesn't respect the encoding of the aspx file and sets it to UTF-8 (which is different from 8859-1 which I have in VS by default on my aspx's) regardless.


    Saturday, March 11, 2006 8:37 AM
  • User-1363174918 posted
    I meant human language i.e. Russian.

    How do you set the language? <META> element is not respected by ASP.NET runtime as runtime does not parse HTML, it only processes <% %> and runat=server elements. ASPX page language must be set in web.config, not in META element (see my blog post). ASP.NET runtime default is UTF-8.
    Saturday, March 11, 2006 11:34 AM
  • User831698009 posted
    I set it in the html-tag:

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="sv-se" lang="sv-se">

    And in web.config I use:
    <globalization requestEncoding="utf-8" responseEncoding="iso8859-1" culture="sv-SE" />

    But as said, I reckon it has to do with the encoding change of the aspx-file which WDP does, the settings above doesn't affect the result.

    Is there a way of getting WDP/MSBuild to respect the original file encoding?


    Saturday, March 11, 2006 1:11 PM
  • User1810020239 posted
    I already tried to put it in my first posting but it was removed somehow... Here's how I set encoding in web.config: <globalization requestEncoding="windows-1251" responseEncoding="windows-1251"/> BTW, proprint.ru is just an example of the page I'm working at. The real one is made with .NET 2.0. Alex
    Saturday, March 11, 2006 3:09 PM
  • User1810020239 posted
    Again, the globalization is removed in my post...
    Saturday, March 11, 2006 4:33 PM
  • User-1363174918 posted
    You also need to set fileEncoding that tells which encoding files are on disk. If you don't set it, ASP.NET assumes UTF-8. xml:lang and lang do not specify encoding or character set, they only tell which language the page is in. lang is useful for Web serach engines, for instance, so they can avoid searching pages in Klingon when user wants pages in Romulan :-)
    Saturday, March 11, 2006 7:46 PM
  • User796746907 posted

    Hi akaKlen,

    Do you have the latest version of WDP?  The February release changed some functionality, including file encoding.  You can download the new version here: http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx

    Hope this helps!

    Monday, March 13, 2006 2:05 PM
  • User1810020239 posted
    Mikhail, thanks for your reply. I changed globalization section to this: globalization requestEncoding="windows-1251" responseEncoding="windows-1251" fileEncoding="windows-1251" and the deployed pages are still unreadable. Looks like developers has to fis this... Alex
    Tuesday, March 14, 2006 7:00 PM
  • User1810020239 posted
    Hi Alison! Yes, I have. And I still have this problem. Alex
    Tuesday, March 14, 2006 7:09 PM
  • User-1363174918 posted
    Are files saved in windows-1251? How exactly did you save them?
    Tuesday, March 14, 2006 11:16 PM
  • User831698009 posted

    I have the same issue as Alex, and I also have the latest release of WDP. My files are by default 1252 (ISO-8859-1), and I've tried to explicitly set that (again so to say) by using the small arrow in the "Save As" and "Save with encoding" dialog, and when opening the file in a text editor I can clearly see that encoding is ISO-8859-1.

    I specify fileEncoding="iso-8859-1" (correct or not?) in my web.config, but the files end up as UTF-8 once passed through WDP anyway.


    Wednesday, March 15, 2006 1:39 AM
  • User1810020239 posted
    I don't use anything special to save them. But if I open ASPX file in notepad the content text is readable. Alex
    Wednesday, March 15, 2006 3:08 AM
  • User-1363174918 posted
    OK, let me follow up with developers who are working on WDP.
    Wednesday, March 15, 2006 10:04 AM
  • User-1363174918 posted

    I can now confirm that there is (was) indeed bug in how WDP and aspnet_merge handle files. It is not fixed and next update should behave better.

    Wednesday, March 15, 2006 8:44 PM
  • User-1115371272 posted

    I know this post is old...but the WDP is still taking our french and special characters and changing them into question marks.


    Thursday, January 23, 2014 4:17 PM