Microsoft Knowledge Base Email Alertz

FIX: Some characters in a text resource may not appear correctly when you try to embed the text resource in a Web application that is built on the .NET Framework 2.0

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 923707 - Last Review: December 3, 2007 - Revision: 1.1

FIX: Some characters in a text resource may not appear correctly when you try to embed the text resource in a Web application that is built on the .NET Framework 2.0

On This Page

SYMPTOMS

When you try to embed a text resource in a Web application that is built on the Microsoft .NET Framework 2.0, some characters in the text resource may not appear correctly. This problem occurs when you set the PerformSubstitution parameter of the WebResource attribute to True.

RESOLUTION

The following file is available for download from the Microsoft Download Center:

Collapse this imageExpand this image
Download
Download the .NET Framework 2.0 System.web.dll security update package now. (http://www.microsoft.com/downloads/details.aspx?familyid=34C375AA-2F54-4416-B1FC-B73378492AA6&displaylang=en) For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591  (http://kbalertz.com/Feedback.aspx?kbNumber=119591/ ) How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.

Note This update addresses a problem for text files that use the following encodings:
  • UTF-8 encoding
  • Other Unicode encodings that use a byte order mark (BOM) and are supported by the .NET Framework 2.0.
This update does not address a scenario in which the text resource is encoded by using an encoding that does not use a BOM, such as Windows-1252. We recommend that you do not use such encodings because browsers must then guess the encoding that is used. Therefore, results can be unpredictable.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For more information, click the following article number to view the article in the Microsoft Knowledge Base:
922770  (http://kbalertz.com/Feedback.aspx?kbNumber=922770/ ) MS06-056: Vulnerability in ASP.NET 2.0 could allow for information disclosure

Steps to reproduce the problem

  1. To embed a text resource in the application, add code that resembes the following code example.
    using System;
    using System.Collections.Generic;
    using System.Text;
    
    using System.Web.UI;
    using System.Net.Mime;
    
    [assembly: WebResource("CLResources.TextFile-Unicode.txt", MediaTypeNames.Text.Plain, PerformSubstitution = true)]
    [assembly: WebResource("CLResources.TextFile-UTF8-Signed.txt", MediaTypeNames.Text.Plain, PerformSubstitution = true)]
    [assembly: WebResource("CLResources.TextFile-Windows1252.txt", MediaTypeNames.Text.Plain, PerformSubstitution = true)]
    
    namespace CLResources
    {
        public class Class1
        {
        }
    }
    
  2. To use the resource in the application, add code that resembes the following code example.
    public partial class _Default : System.Web.UI.Page 
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            HyperLinkUnicode.NavigateUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(CLResources.Class1), "CLResources.TextFile-Unicode.txt");
            HyperLinkUtf8.NavigateUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(CLResources.Class1), "CLResources.TextFile-UTF8-Signed.txt");
            HyperLinkWindows1252.NavigateUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(CLResources.Class1), "CLResources.TextFile-Windows1252.txt");
            
        }
    }
    
  3. Run the application.

APPLIES TO
  • Microsoft .NET Framework 2.0
Keywords: 
kbfix kbqfe kbresource kbstring kbdisplay KB923707
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate