What's "ANSI_X3.4-1968" encoding?
This is another name for USAS X3.4-1968
, a revision of ASCII
that is distinguished by being:
the first revision to allow a linefeed (
LF
) to occur on its own (i.e. not preceded by or followed by a carriage return (CR
)).the revision that introduced the common name of
(US-)ASCII
.
This is basically ASCII
as we think of it, although there were two minor revisions that followed it.
If you're curious where it comes from in cpython, the value is computed from the locale module using langinfo
.
Here's a tiny C program which demonstrates how the _locale
module determines this information:
#include <langinfo.h>
#include <locale.h>
#include <stdio.h>
int main () {
setlocale(LC_ALL, "");
printf("%s\n", nl_langinfo(CODESET));
return 0;
}
And some sample output:
$ LANG= ./a.out
ANSI_X3.4-1968
$ LANG=en_US.UTF-8 ./a.out
UTF-8
python normalizes the ansi name to ascii
(or US-ASCII
)