BUG: The .NET configuration provider defaults to UTF-8 encoding when creating new configuration files (306725)



The information in this article applies to:

  • Microsoft Windows Management Instrumentation in . NET
  • Microsoft .NET Framework 1.1
  • Microsoft .NET Framework 1.0
  • Microsoft .NET Framework Class Libraries 1.1
  • Microsoft .NET Framework Class Libraries 1.0
  • Microsoft Visual Studio .NET (2003), Professional Edition
  • Microsoft Visual Studio .NET (2002), Professional Edition

This article was previously published under Q306725

SYMPTOMS

When you use the Windows Management Instrumentation (WMI) configuration provider to create a new configuration file, UTF-8 character encoding is used by default.

CAUSE

The WMI configuration provider does not provide control over the XML encoding that is used in a configuration file. It only uses preexisting encoding if this is already specified in the configuration file.

RESOLUTION

To work around this problem, you can add an encoding attribute to the header of the configuration file through other means (such as through an XML parser, a text editor, or direct file access). For example, you could start with a template configuration file that has the proper XML encoding header.

If you specify the encoding in a configuration file, the WMI configuration provider applies the encoding on both read and write operations. The provider also preserves the encoding information in the XML file.

STATUS

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

Modification Type:MinorLast Reviewed:1/25/2006
Keywords:kbvs2005doesnotapply kbvs2005swept kbtshoot kbvs2002sp1sweep kbbug kbnofix kbreadme KB306725 kbAudDeveloper