ANSI encoding is a slightly generic term used to refer to the standard code page on a system, usually Windows. It is more properly referred to as Windows-1252 on Western/U.S. systems. (It can represent certain other Windows code pages on other systems.) This is essentially an extension of the ASCII character set in that it includes all the ASCII characters with an additional 128 character codes. This difference is due to the fact that "ANSI" encoding is 8-bit rather than 7-bit as ASCII is (ASCII is almost always encoded nowadays as 8-bit bytes with the MSB set to 0). See the article for an explanation of why this encoding is usually referred to as ANSI.

The name "ANSI" is a misnomer, since it doesn't correspond to any actual ANSI standard, but the name has stuck. ANSI is not the same as UTF-8.

Answer from Noldorin on Stack Overflow
Top answer
1 of 11
334

ANSI encoding is a slightly generic term used to refer to the standard code page on a system, usually Windows. It is more properly referred to as Windows-1252 on Western/U.S. systems. (It can represent certain other Windows code pages on other systems.) This is essentially an extension of the ASCII character set in that it includes all the ASCII characters with an additional 128 character codes. This difference is due to the fact that "ANSI" encoding is 8-bit rather than 7-bit as ASCII is (ASCII is almost always encoded nowadays as 8-bit bytes with the MSB set to 0). See the article for an explanation of why this encoding is usually referred to as ANSI.

The name "ANSI" is a misnomer, since it doesn't correspond to any actual ANSI standard, but the name has stuck. ANSI is not the same as UTF-8.

2 of 11
70

Technically, ANSI should be the same as US-ASCII. It refers to the ANSI X3.4 standard, which is simply the ANSI organisation's ratified version of ASCII. Use of the top-bit-set characters is not defined in ASCII/ANSI as it is a 7-bit character set.

However years of misuse of the term by the DOS and subsequently Windows community has left its practical meaning as “the system codepage of whatever machine is being used”. The system codepage is also sometimes known as ‘mbcs’, since on East Asian systems that can be a multiple-byte-per-character encoding. Some code pages can even use top-bit-clear bytes as trailing bytes in a multibyte sequence, so it's not even strict compatible with plain ASCII... but even then, it's still called “ANSI”.

On US and Western European default settings, “ANSI” maps to Windows code page 1252. This is not the same as ISO-8859-1 (although it is quite similar). On other machines it could be anything else at all. This makes “ANSI” utterly useless as an external encoding identifier.

🌐
Wikipedia
en.wikipedia.org › wiki › ANSI_character_set
ANSI character set - Wikipedia
August 13, 2026 - ANSI character set has no well-defined meaning and has been used to refer to the following, among other things:
Discussions

How to convert .txt to ANSI encoding
I am trying to convert files from ... this link [https://activities.uipath.com/docs/supported-character-encoding] But in the list I’m not finding ANSI encoding, it just says that “If no Byte Order Marks are detected, the system ANSI code page is selected by default.” And ... More on forum.uipath.com
🌐 forum.uipath.com
5
0
August 2, 2018
UTF-8 and ANSI encoding issue
Hi all, i have a code that writes to a file with utf-8 encoding. But when i try to open the same file i created in the same script i get an error message saying it can’t read it because the file is in ANSI. Here is the… More on discuss.python.org
🌐 discuss.python.org
10
0
November 23, 2023
ENCODING PROBLEM- Reading an ANSI File
You are probably not reading the file with the right encoding. Get-Content has an -Encoding parameter that has ascii as an option, or you can pass-in a system.text.encoding object. The SteamReader can also take an encoding as one of the constructor parameters. You can use [System.IO.StreamReader]::new to see them all. e: looks like this site has a list of encodings that contain the character: https://unicode.scarfboy.com/?s=%E2%80%99 More on reddit.com
🌐 r/PowerShell
5
3
February 7, 2024
Windows 10 1903) How to change Default Encoding UTF-8 to ANSI In Notepad?
Hello,does anyone know if you can re-enable ANSI encoding by registry in the notepad, instead of the default UTF8 encoding, which is given since Windows 10... More on techcommunity.microsoft.com
🌐 techcommunity.microsoft.com
12
0
November 7, 2019
🌐
Vovsoft
vovsoft.com › blog › difference-between-ansi-and-utf-8
Difference between ANSI and UTF-8 - Vovsoft
September 19, 2022 - ANSI encoding is a generic term used to refer to the standard code page on a system.
🌐
Community
community.safe.com › home › forums › fme form › transformers › character encoding - ansi = iso-8859-1?
Character encoding - ANSI = iso-8859-1? | Community
May 27, 2020 - As stated above, the default encoding will be system default. If you change the encoding to <not set>, the attributes will be encoded as is from the source. So it seems that ANSI means "system encoding".
🌐
EDI Academy Blog
ediacademy.com › blog › ansi-encoding
ANSI Encoding | EDI Blog
March 24, 2024 - ANSI encoding refers to a character encoding standard used primarily in the United States.
🌐
UiPath Community
forum.uipath.com › help
How to convert .txt to ANSI encoding - Help - UiPath Community Forum
August 2, 2018 - Hello Guys! I am trying to convert files from any encoding to ANSI like this: UiPath.Core.Activities.ReadTextFile and then UiPath.Core.Activities.WriteTextFile The last activity has an option called Encoding, which parameters are defined this link [https://activities.uipath.com/docs/supported-character-encoding] But in the list I’m not finding ANSI encoding, it just says that “If no Byte Order Marks are detected, the system ANSI code page is selected by default.” And I’m writing “” to forc...
Find elsewhere
🌐
Python.org
discuss.python.org › python help
UTF-8 and ANSI encoding issue - Python Help - Discussions on Python.org
November 23, 2023 - Hi all, i have a code that writes to a file with utf-8 encoding. But when i try to open the same file i created in the same script i get an error message saying it can’t read it because the file is in ANSI. Here is the code of creating the file: with open(new_file, 'w', encoding='utf-8') as f: for item in items: f.write('%s\n' % item) with open(new_file, 'a', encoding='utf-8') as f: for line in lines: f.write('%s\n' % line) This is the code which supposed to open the ...
Top answer
1 of 2
5

What is the difference between Windows-1252 and ANSI encoding?

See below. In practice it probably won't make much difference to your conversion.

If you keep a copy of the original file then you can always apply a different conversion if necessary.

Having said that there are ways of converting UTF-8 to ANSI.


Windows-1252

This character encoding is a superset of ISO 8859-1 in terms of printable characters, but differs from the IANA's ISO-8859-1 by using displayable characters rather than control characters in the 80 to 9F (hex) range. Notable additional characters include curly quotation marks and all the printable characters that are in ISO 8859-15. It is known to Windows by the code page number 1252, and by the IANA-approved name "windows-1252".

...

Historically, the phrase "ANSI Code Page" (ACP) is used in Windows to refer to various code pages considered as native. The intention was that most of these would be ANSI standards such as ISO-8859-1. Even though Windows-1252 was the first and by far most popular code page named so in Microsoft Windows parlance, the code page has never been an ANSI standard. Microsoft explains, "The term ANSI as used to signify Windows code pages is a historical reference, but is nowadays a misnomer that continues to persist in the Windows community.

Source Windows-1252

Note that is spite of the above statement by Microsoft they still call Windows 1252 "ANSI":

Source Code Page 1252 Windows Latin 1 (ANSI)

2 of 2
4

Are Windows-1252 and ANSI the same thing?

– Yes, for Western European languages, they are identically the same encodings. 1

For other natural languages, see my table at the end of this answer.

Unfortunately, the Wikipedia pages on the topic, this and this,
are riddled with confusing statements and unreferenced claims.

You are much better off going directly to one of the sources that Wikipedia does reference.
It was written in May 2002 and says :

The term “ANSI” as used to signify Windows code pages is a historical reference, but is nowadays a misnomer that continues to persist in the Windows community. The source of this comes from the fact that the Windows code page 1252 was originally based on an ANSI draft, which became ISO Standard 8859-1. However, in adding code points to the range reserved for control codes in the ISO standard, the Windows code page 1252 and subsequent Windows code pages originally based on the ISO 8859-x series deviated from ISO. To this day [May 2002], it is not uncommon to have the development community, both within and outside of Microsoft, confuse the 8859-1 code page with Windows 1252, as well as see “ANSI” or “A” used to signify Windows code page support.

References

  • Charts showing the Windows-1252 character set | Section 4
  • Post containing a table of all ten Windows code pages
  • Windows-1252 | Wikipedia
  • ISO/IEC 8859-1 | Wikipedia
  • Unicode and Windows XP | Cathy Wissink, Microsoft

1 For charts displaying the Windows-1252 character set, see this post, Section 4.

🌐
URL Decode
urldecoder.org › dec › ansi
URL Decoding of "ansi" - Online
Although it is known as URL encoding it is, in fact, used more generally within the main Uniform Resource Identifier (URI) set, which includes both Uniform Resource Locator (URL) and Uniform Resource Name (URN).
🌐
TutorialsPoint
tutorialspoint.com › article › difference-between-ansi-and-unicode
Difference between ANSI and Unicode
August 16, 2023 - It is frequently used to refer ... Windows operating system environment, where it usually refers to the Windows-1252-character encoding....
🌐
Alan Wood
alanwood.net › demos › ansi.html
ANSI character set and equivalent Unicode and HTML characters
ANSI characters 32 to 127 correspond to those in the 7-bit ASCII character set, which forms the Basic Latin Unicode character range. Characters 160–255 correspond to those in the Latin-1 Supplement Unicode character range. Positions 128–159 in Latin-1 Supplement are reserved for controls, but most of them are used for printable characters in ANSI; the Unicode equivalents are noted in the table below.
🌐
Reddit
reddit.com › r/powershell › encoding problem- reading an ansi file
r/PowerShell on Reddit: ENCODING PROBLEM- Reading an ANSI File
February 7, 2024 -

I have a script I wrote in PowerShell ISE v5.1 It is reading a tab delimited file that Notepad++ shows as "ANSI". The file contains apostrophes that is not converting properly. The character is ’ not the standard ', The hex value I think is 2019. When running the OutputEncoding command it shows Western European (Windows). Any thoughts on how to read this file properly?

$File_streamreader = New-Object System.IO.StreamReader($myfile)
While (($readeachline = $File_streamreader.Readline()) -ne $null) {....

Thank you for your help.

🌐
Microsoft Community Hub
techcommunity.microsoft.com › microsoft community hub › communities › products › windows › windows 10
Windows 10 1903) How to change Default Encoding UTF-8 to ANSI In Notepad? | Microsoft Community Hub
November 7, 2019 - It's suspected to be a bug in Windows and hasn't been fixed in four years, and the only alternative is to change the default editor to Notpad++ or change the encoding settings on save.
🌐
Gaijin
gaijin.at › en › infos › ascii-ansi-character-table
ASCII and ANSI Character Table
The generic term ANSI (American National Standards Institute) is used for 8-bit character sets. These character sets contain the unchanged ASCII character set. In addition, they contain further characters from 128 to 255, which differ in the various ANSI character sets.
🌐
W3Schools
w3schools.com › charsets › ref_html_ansi.asp
HTML Windows-1252 - ANSI Reference
The intention was that these character sets would be an ANSI standard like ISO-8859-1.
🌐
Microsoft Learn
learn.microsoft.com › en-us › windows › win32 › intl › code-page-identifiers
Code Page Identifiers - Win32 apps | Microsoft Learn
January 7, 2021 - ANSI code pages can be different on different computers, or can be changed for a single computer, leading to data corruption.
🌐
AVEVA
docs.aveva.com › bundle › plant-scada › page › 1095511.html
ASCII and ANSI Character Sets
Skip to main contentSkip to search · Powered by Zoomin Software. For more details please contactZoomin · © 2015-2026 AVEVA Group Limited or its subsidiaries · CopyrightPrivacy PolicyTerms and conditionsAVEVA GDPR StatementContact Us · Powered By