Encoding Dialog Box

Use the Encoding dialog box to perform the following actions:

  • Open existing files (for example, .xml, .htm, .asp, .aspx) that are incorrectly tagged, lack a character-set attribute, or have an encoding that cannot be detected by Visual Studio.

  • Change the character set of files created or modified in a Visual Studio editor.

  • Specify a language encoding scheme to apply when a file is opened. If the file is not saved with a Unicode encoding, the system default codepage, which is determined by the system default locale, is used. For example, if the system default locale is English, the encoding will use codepage 1252, which is the encoding for the Western European language group.

The Encoding dialog box can be opened in several ways, depending on the task you want to perform. For more information, see How to: Manage Files with Encoding.

When you open a downloaded .html file, Visual Studio 2008 detects the charset (character set) parameter that is defined in the http meta tag. Visual Studio 2008 uses that information to convert the document to Unicode. However, many HTML pages do not include the optional charset attribute in their markup. If the charset attribute is absent or incorrectly defined in the file that you want to open, and if the file was created on a computer with different default encoding than the encoding on your computer, the characters in the file will display incorrectly.

If you know the character set used by the author of the downloaded file, you can use the Encoding dialog box to specify that character set. When notified of the native character set used in the .html file, Visual Studio 2008 converts the file into a form that is readable on your computer. For more information about how to change the character set of .html files, see HTML Document Properties, Properties Window.

  • Encoding
    Use this list to select an encoding scheme. By default, the encoding scheme currently being used is selected. For example, the initial default setting for U.S. English is Western European (Windows) — Codepage 1252.

  • Line Endings
    Use this list to select a line-ending type for the file. There are four possible settings:

    Current Setting

    Uses the current line-ending setting for the system.

    Windows

    Uses CR + LF.

    Macintosh

    Uses CR.

    Unix

    Uses LF.

See Also

Tasks

How to: Manage Files with Encoding

Concepts

Character Sets

Reference

Open With Dialog Box

New File Dialog Box

HTML Document Properties, Properties Window

Advanced Save Options Dialog Box

General, Text Editor, Options Dialog Box

Other Resources

Globalizing and Localizing Applications

Files, User Interface Elements

Change History

Date

History

Reason

December 2009

Added See Also link to Text Editor Options.

Customer feedback.