Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
Redmond desk3 min

Windows Code Pages: How IDs, ANSI, OEM, and UTF-8 Work

A Windows code page maps bytes to characters. Learn the difference between ANSI and OEM pages, decode common identifiers, and understand UTF-8 support.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Windows code page is a numbered character encoding: a rule for turning text bytes into characters and characters back into bytes. The number identifies a particular encoding, not a universal character set. Windows “ANSI” code pages and OEM code pages are related but serve different roles; UTF-8 is code page 65001.

What a Windows code page does

Text stored or passed as bytes needs an encoding so software can interpret each byte or sequence of bytes as a character. A code page supplies that mapping. Microsoft uses “Windows code pages” for a family commonly called ANSI code pages, particularly in legacy, non-Unicode Windows interfaces. A code-page number tells you which encoding is in use; it does not tell you that every encoding with a similar number or label has the same character coverage.

As an Amazon Associate I earn from qualifying purchases.

For Windows and OEM code pages, byte values from 0x00 through 0x7F correspond to ASCII. The meanings of values from 0x80 through 0xFF depend on the code page. Some pages use one byte per character; double-byte character set (DBCS) pages use lead bytes and two-byte sequences for some characters. That is why the same byte can display as different text under different code pages.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Windows ANSI and OEM code pages are different

Windows ANSI code pages are used by many legacy Windows API functions with an A suffix. Their corresponding W functions use wide-character Unicode text. OEM code pages have a separate historical association with MS-DOS and are still relevant in some console contexts. “ANSI” and “OEM” are therefore not interchangeable names for one encoding.

Identifier Microsoft’s mapping Context
1252 Windows-1252 Windows code page
437 OEM United States OEM code page
65001 UTF-8 UTF-8 code page

These mappings are listed in Microsoft’s Code Page Identifiers reference. The number alone does not establish which encoding a particular file or byte sequence uses.

How to check the active Windows code-page identifiers

Windows exposes separate functions for the current ANSI and OEM identifiers. GetACP returns the system’s active Windows ANSI code-page identifier; GetOEMCP returns the OEM identifier. See Microsoft’s documentation for GetACP and GetOEMCP.

These functions report machine settings, not reliable detection of an arbitrary file’s encoding. A file may have been created with a different code page, and guessing from the current system setting can produce incorrect characters. For legacy data, determine how its bytes were actually encoded before interpreting or converting them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why code-page conversions can damage text

A code page can represent only the characters included in its mapping. If text contains a character that the destination page cannot represent, conversion may lose information. The Windows ANSI code page can also differ between computers or change, which can make legacy applications behave inconsistently across systems. Microsoft explains these compatibility risks in its Code Pages guidance.

When Windows uses UTF-8

Application active code page

Starting with Windows version 1903 (May 2019 Update), packaged apps can specify UTF-8 as their active code page in an app manifest; unpackaged apps can use a fusion manifest. This is an application-specific mechanism, not a system-wide guarantee that all software uses UTF-8. Microsoft also notes that GDI does not support setting activeCodePage per process. The current details are in Microsoft’s Use UTF-8 code pages in Windows apps guidance, dated 2025-07-17.

Console input and output

Console code-page configuration is a separate matter from an app’s active code page. For the API scenarios Microsoft documents, console input and output code pages can be set to 65001 for UTF-8. Follow the scope and setup in Microsoft’s Console Application Issues guidance rather than assuming that changing one code-page setting changes every Windows subsystem.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What to use in new applications

For new Windows applications, use Unicode text handling to avoid dependence on machine-specific legacy code pages and to support localization. Choose UTF-8 or UTF-16 as appropriate for the application and its interfaces. Microsoft’s Code Pages reference recommends Unicode for new Windows applications. When working with existing bytes, however, identify their actual encoding instead of relabeling them as Unicode or assuming the active Windows code page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.