Well, the term
ASCII (short for
American
Standard
Code for
Information
Interchange) is not really correct in any conversion item.
UTF-8 to ASCII should be
UTF-8 to 8-bit encoded according to current code page set for the file. But that would be a little bit long.
UTF-8 to ANSI would be also not correct as not all
code pages are standardized by the
American National Standards Institute. Some code pages are standardized by other organizations or companies.
The ASCII table contains only 128 characters with code value 0 to 127 decimal as you can read on
ASCII Table and Description and on Wikipedia article about
ASCII. There is also an extended ASCII table, but
code page 437 (North America) or
code page 850 (Western Europe) is not equal the extended ASCII table.
I think, 99.9999% of all computer users writing text do not know anything about the various standards for encoding text. A minority of computer users know at all about the main difference between Unicode and ASCII/ANSI encoded characters - multi-byte versus single-byte encoding.
ASCII and ANSI are common synonyms for characters encoded with 8 bits and Unicode is understood usually as encoding for a wide range of characters.
Okay, after this small lesson about various text encoding standards, back to command
UTF-8 to ASCII in UltraEdit.
This command converts a file encoded in UTF-8
(and converted to UTF-16 Little Endian on opening of the file in memory) to the code page set currently for the active file via
View - Set Code Page (since UE v12.10) or via the encoding item in the standard (non basic) status bar with UE v19.00 or later. Therefore it is possible to convert a UTF-8 encoded file directly to code page 437 by selecting first
437 (OEM - United States) in
Code Page Selection dialog or
850 (OEM - Multilingual Latin I) for code page 850, or selecting via the status bar in group
OEM the item
437 (OEM - United States) or
850 (OEM - Multilingual Latin I).
The same is true for all other UltraEdit file conversion commands containing the term
ASCII.
ASCII means always: code page as currently selected for the file to convert.
Hint for users with UE 19.00 or later:
The standard status bar of UE v19.00 or later supports selecting the code page for the active file via a list item opening a menu with the sublists
Default,
Unicode,
MAC,
IBM,
ANSI,
ISO,
OEM,
Others each containing appropriate items. The list item changes the code page respectively text encoding for the active file, but not the display font. So the user has to select a font and/or font script supporting the selected text encoding/code page to get the text correct displayed, too.
The default code page for 8-bit encoded files is set via
Advanced - Set Code Page/Locale and is usually the code page defined by the system (= operating system) which means on Windows the code page set for non Unicode files in the regional and language settings of Windows.
UltraEdit since v12.10 supports automatic detection of other code pages than default system code page for 8-bit encoded text files according to
charset (HTML, XHTML) or
encoding (XML) declaration at top of HTML, XHTML and XML files.
I don't know for sure, but I think the commands
ANSI to OEM and
OEM to ANSI are just running
CString::AnsiToOem respectively
CString::OemToAnsi on entire file. That means at least for North American and Western European countries (and perhaps also other countries) a conversion between the code pages
1252 (ANSI) and
437 or
850 (OEM). I'm using those commands often already several years in various UltraEdit versions since v8.00 and could never see a mistake in conversion.
Please note that there are characters in code page 1252 which are not available in code page 437 or 850 and vice versa. Those characters can be therefore not converted to the other code page with correct display of the characters after the conversion.
And of course after making the conversion, the font for display must be changed via
View - Set Font, or just the
Script of the font if the used font also supports OEM code pages, to get the characters displayed correct again after the conversion.
Special hint: With using
OEM Character Set command added manually to a customized toolbar or menu as explained at
Manual customization of OEM Character Set command it is possible to quickly change display of characters between ANSI and OEM without changing the display font setting. And also non ASCII characters entered by keyboard are correct added to file according to
OEM Character Set state.