enca(1)
π enca(1) β the manual page bestie π
okay so. sit down, grab a boba, because we're learning enca β short for detect and convert encoding of text files β and it is genuinely one of the most underrated little tools in your whole terminal. no cap. π¦
πΈ NAME πΈ
enca β detect and convert encoding of text files β¨
π SYNOPSIS π
enca [-L LANGUAGE] [OPTION]... [FILE]...
enconv [-L LANGUAGE] [OPTION]... [FILE]...
like. two names, one icon. enconv is just enca in a different outfit. π
β¨ INTRODUCTION AND EXAMPLES β¨
so if you're lucky β like, truly blessed by the encoding gods β the only two things you will ever need to know in your entire life are these:
enca FILE
which tells you which encoding file FILE uses, and does not touch the file. it just looks. respectfully. π
and
enconv FILE
which converts file FILE to your locale's native encoding. glow-up time. π
wanna convert to some other encoding instead? use the -x option (peep the -x entry down in section OPTIONS, plus sections CONVERSION and ENCODINGS for the deets).
both of these work with multiple files, and with standard input / standard output too. e.g.
enca -x latin2 <sometext | lpr
which makes absolutely sure file sometext is in ISO Latin 2 when it gets sent to the printer. chef's kiss. π«Ά
now. the main reason these commands will fail and turn your files into garbage β and i mean unrecognizable, tragic, lowercase-garbage β is that Enca needs to know the language of the text to detect the encoding. it tries to figure out your language and preferred charset from locale settings, and bestie, those might not be what you want. π
that's why you can (or honestly have to) use the -L option to tell it the right language. so picture this: you downloaded some Russian HTML file, file.htm, and it claims it's windows-1251 but it absolutely is not. so you run
enca -L ru file.htm
and find out it's KOI8-R (for example). slay. be warned though β right now there are not many supported languages (see section LANGUAGES). π
another warning, and this one matters: several of Enca's features β namely its charset conversion capabilities β strongly depend on what other tools are installed on your system (see section CONVERSION). so run
enca --version
to get the list of features (see section FEATURES). also try
enca --help
to get a description of all the other Enca options β and honestly, to find out the rest of this manual page is redundant. π
π DESCRIPTION π
Enca reads the text files you give it β or standard input when you give it none β and uses knowledge about their language (which must be supported by you, the user) plus a mixture of parsing, statistical analysis, guessing, and black magic πͺ to determine their encodings. then it prints that to standard output. or it confesses it has no idea what the encoding could be. honesty is a love language.
by default, Enca presents results as multiline human-readable descriptions. several other formats are available β see Output type selectors below.
Enca can also convert files to some other encoding ENC when you ask it to β either using a built-in converter, some conversion library, or by calling an external converter. versatile queen. π
Enca's primary goal is to be usable unattended, as an automatic conversion tool β though it perhaps has not reached this point yet (please see section SECURITY). we're getting there. manifestation. β¨
please note: except in rare cases, Enca really has to know the language of the input files to give you a reliable answer. on the other hand, once it does know, it can cope quite well with files that aren't purely textual β it can even detect the charset of text strings inside some binary file. of course, it depends on the character of the non-text component. iykyk.
Enca does not care about the structure of input files. it views them as one uniform piece of text/data. so for multipart files (mailboxes, for example), you have to use some tool that knows the structure to extract the individual parts first. that's the cost of being able to detect encodings of any damaged, incomplete, or otherwise incorrect files. worth it, tbh. π
β¨ OPTIONS β¨
Okay bestie, this is the big one, so buckle up π The options come in a few little categories: operation mode options, output type selectors, guessing parameters, conversion parameters, general options and listings.
All long options can be abbreviated as long as they're unambiguous, and just so you know β mandatory parameters of long options are mandatory for short options too. No sneaking out of it π
π Operation modes π
These are the big-picture moods Enca can be in:
-c,--auto-convertβ Equivalent to calling Enca asenconv. If no output type selector is specified, it detects file encodings, guesses your preferred charset from locales, and converts files to it (this one's only available with the+target-charset-autofeature).-g,--guessβ Equivalent to calling Enca asenca. If no output type selector is specified, it detects file encodings and reports them. That's the classic detective mode π
π Output type selectors π
These pick what action Enca takes once it figures out the encoding. Most of them just choose between different names, formats and conventions for how encodings can be printed β but one of them (-x) is special: it tells Enca to recode files to some other encoding ENC.
These options are mutually exclusive! If you specify more than one output type selector, the last one takes precedence. Periodt.
Several output types represent the charset name used by some other program, but not all these programs know all the charsets which Enca recognises. Be warned: Enca makes no difference between an unrecognised charset and a charset having no name in a given namespace in such situations. π
-d,--detailsβ It used to print a few pages of details about the guessing process, but since Enca is just a program linked against the Enca library, that's not possible anymore. So it's roughly equivalent to--human-readable, except it reports the failure reason when Enca doesn't recognize the encoding. Glow-down but make it informative π-e,--enca-nameβ Prints Enca's nice name of the charset, i.e., perhaps the most generally accepted and more or less human-readable charset identifier, with surfaces appended. This name is used when calling an external converter, too.-f,--human-readableβ Prints a verbal description of the detected charset and surfaces β something a human understands best. This is the default behaviour β¨
The precise format is following: the first line contains the charset name alone, and it's followed by zero or more indented lines containing names of detected surfaces. This format is not, however, suitable or intended for further machine-processing, and the verbal charset descriptions are like to change in the future. So don't you dare parse it, bestie π
-i,--iconv-nameβ Prints howiconv(3)(and/oriconv(1)) calls the detected charset. More precisely, it prints one, more or less arbitrarily chosen, alias accepted by iconv. A charset unknown to iconv counts as unknown.
This output type makes sense only when Enca is compiled with iconv support (feature +iconv-interface).
-r,--rfc1345-nameβ Prints the RFC 1345 charset name. When such a name doesn't exist because RFC 1345 doesn't define a given encoding, some other name defined in some other RFC β or just the name which the author considers`the most canonical'β is printed.
Since RFC 1345 doesn't define surfaces, no surface info is appended.
-m,--mime-nameβ Prints the preferred MIME name of the detected charset. This is the name you should normally use when fixing e-mails or web pages. π
A charset not present in http://www.iana.org/assignments/character-sets counts as unknown.
-s,--cstocs-nameβ Prints howcstocs(1)calls the detected charset. A charset unknown to cstocs counts as unknown.-n,--name=WORDβ Prints the charset (encoding) name selected by WORD (which can be abbreviated as long as it's unambiguous). For the names listed above,--name=WORDis equivalent to--WORD.
Using aliases as the output type causes Enca to print a list of all accepted aliases of the detected charset. Aliases stay winning π
-x,--convert-to=[..]ENCβ Converts the file to encodingENC. π₯
The optional .. before the encoding name has no special meaning, except you can use it to remind yourself that, unlike in recode(1), you should specify the desired encoding, instead of the current one. Little brain-hack, love that for you π§
You can use recode(1) recoding chains or any other kind of braindead recoding specification for ENC, provided that you tell Enca to use some tool understanding it for conversion (see section CONVERSION).
When Enca fails to determine the encoding, it prints a warning and leaves the file as is; when it is run as a filter it tries to do its best to copy standard input to standard output unchanged. Nevertheless, you should not rely on it and do backup. Seriously. Backup. π
π¦ Guessing parameters π¦
There's only one of these: -L, which sets the language of the input files. This option is mandatory (but see below π).
-L,--language=LANGβ Sets the language of input files to LANG.
More precisely, LANG can be any valid locale name (or alias with the +locale-alias feature) of some supported language. You can also specify none as the language name β only multibyte encodings are recognised then. Run
enca --list languages
to get a list of supported languages. When you don't specify any language, Enca tries to guess your language from locale settings and assumes input files use this language. See section LANGUAGES for details.
π Conversion parameters π
These give you finer control of how charset conversion will be performed. They don't affect anything when -x is not specified as output type. Please see section CONVERSION for the gory conversion details π«£
-C,--try-converters=LISTβ Appends the comma separated LIST to the list of converters that will be tried when you ask for conversion. Their names can be abbreviated as long as they're unambiguous. Run
enca --list converters
to get a list of all valid converter names (and see section CONVERSION for their description).
The default list depends on how Enca has been compiled β run
enca --help
to find out the default converter list.
Note the default list is used only when you don't specify-Cat all. Otherwise, the list is built as if it were initially empty and every-Cadds new converter(s) to it. Moreover, specifyingnoneas a converter name causes clearing the converter list. Full reset, no cap π§Ό
-E,--external-converter-program=PATHβ Sets the external converter program name to PATH. The default external converter depends on how enca has been complied, and the possibility to use external converters may not be available at all. Run
enca --help
to find out the default converter program in your enca build.
β General options β
These ones don't fit into the other option categories... they're just doing their own thing, main character energy π
-p,--with-filenameβ Forces Enca to prefix each result with the corresponding file name. By default, Enca prefixes results with filenames when run on multiple files.
Standard input is printed as STDIN and standard output as STDOUT (the latter can be probably seen in error messages only).
-P,--no-filenameβ Forces Enca to not prefix results with file names. By default, Enca doesn't prefix the result with a file name when run on a single file (including standard input).-V,--verboseβ Increases verbosity level (each use increases it by one).
Currently this option is not very useful because different parts of Enca respond differently to the same verbosity level, mostly not at all. It's giving decorative π
πΈ Listings πΈ
These are all terminal, i.e. when Enca encounters some of them it prints the required listing and terminates without processing any following options. One and done, iconic π
-h,--helpβ Prints brief usage help.-G,--licenseβ Prints the full Enca license (through a pager, if possible).-l,--list=WORDβ Prints the list specified by WORD (which can be abbreviated as long as it's unambiguous). Available lists include:built-in-charsets. All encodings convertible by the built-in converter, by group (both input and output encoding must be from this list and belong to the same group for internal conversion).built-in-encodings. Equivalent tobuilt-in-charsets, but considered obsolete; will be accepted with a warning, for a while.converters. All valid converter names (to be used with-C).charsets. All encodings (charsets). You can select what names will be printed with--nameor any name output type selector (of course, only encodings having a name in the given namespace will be printed then) β the selector must be specified before--list.encodings. Equivalent tocharsets, but considered obsolete; will be accepted with a warning, for a while.languages. All supported languages together with charsets belonging to them. Note the output type selects the language name style, not the charset name style, here.names. All possible values of the--nameoption.lists. All possible values of this option. (Crazy?) π€ͺsurfaces. All surfaces Enca recognises.
-v,--versionβ Prints program version and list of features (see section FEATURES).
β¨ CONVERSION β¨
okay so Enca was originally designed as a tool for guessing encoding only, but now it features several methods of charset conversion. You can control which of them will be used with -C.
Enca sequentially tries converters from the list specified by -C until it finds some that is able to perform required conversion or until it exhausts the list. You should specify preferred converters first, less preferred later. External converter (extern) should be always specified last, only as last resort, since it's usually not possible to recover when it fails. The default list of converters always starts with built-in and then continues with the first one available from: librecode, iconv, nothing.
It should be noted when Enca says it is not able to perform the conversion it only means none of the converters is able to perform it. It can be still possible to perform the required conversion in several steps, using several converters, but to figure out how, human intelligence is probably needed. π
π Built-in converter π
is the simplest and far the fastest of all, can perform only a few byte-to-byte conversions and modifies files directly in place (may be considered dangerous, but is pretty efficient). You can get list of all encodings it can convert with
enca --list built-in
Beside speed, its main advantage (and also disadvantage) is that it doesn't care: it simply converts characters having a representation in target encoding, doesn't touch anything else and never prints any error message.
This converter can be specified as built-in with -C.
πΈ Librecode converter πΈ
is an interface to GNU recode library, that does the actual recoding job. It may or may not be compiled in; run
enca --version
to find out its availability in your enca build (feature +librecode-interface).
You should be familiar with recode(1) before using it, since recode is a quite sophisticated and powerful charset conversion tool. You may run into problems using it together with Enca particularly because Enca's support for surfaces not 100% compatible, because recode tries too hard to make the transformation reversible, because it sometimes silently ignores I/O errors, and because it's incredibly buggy. Please see GNU recode info pages for details about recode library.
This converter can be specified as librecode with -C.
π¦ Iconv converter π¦
is an interface to the UNIX98 iconv(3) conversion functions, that do the actual recoding job. It may or may not be compiled in; run
enca --version
to find out its availability in your enca build (feature +iconv-interface).
While iconv is present on most today systems it only rarely offer some useful set of available conversions, the only notable exception being iconv from GNU libc. It is usually quite picky about surfaces, too (while, at the same time, not implementing surface conversion). It however probably represents the only standard(ized) tool able to perform conversion from/to Unicode. Please see iconv documentation about for details about its capabilities on your particular system.
This converter can be specified as iconv with -C.
π External converter π
is an arbitrary external conversion tool that can be specified with -E option (at most one can be defined simultaneously). There are some standard, provided together with enca: cstocs, recode, map, umap, and piconv. All are wrapper scripts: for cstocs(1), recode(1), map(1), umap(1), and piconv(1).
Please note enca has little control what the external converter really does. If you set it to /bin/rm you are fully responsible for the consequences. π
If you want to make your own converter to use with enca, you should know it is always called
CONVERTER ENC_CURRENT ENC FILE [-]
where CONVERTER is what has been set by -E, ENC_CURRENT is detected encoding, ENC is what has been specified with -x, and FILE is the file to convert, i.e. it is called for each file separately. The optional fourth parameter, -, should cause (when present) sending result of conversion to standard output instead of overwriting the file FILE. The converter should also take care of not changing file permissions, returning error code 1 when it fails and cleaning its temporary files. Please see the standard external converters for examples.
This converter can be specified as extern with -C.
π Default target charset π
The straightforward way of specifying target charset is the -x option, which overrides any defaults. When Enca is called as enconv, default target charset is selected exactly the same way as recode(1) does it.
If the DEFAULT_CHARSET environment variable is set, it's used as the target charset.
Otherwise, if you system provides the nl_langinfo(3) function, current locale's native charset is used as the target charset.
When both methods fail, Enca complains and terminates. π
π«Ά Reversibility notes π«Ά
If reversibility is crucial for you, you shouldn't use enca as converter at all (or maybe you can, with very specifically designed recode(1) wrapper). Otherwise you should at least know that there four basic means of handling inconvertible character entities:
failβ this is a possibility, too, and incidentally it's exactly what current GNU libc iconv implementation does (recode can be also told to do it)- don't touch them β this is what enca internal converter always does and recode can do; though it is not reversible, a human being is usually able to reconstruct the original (at least in principle)
- approximate them β this is what cstocs can do, and recode too, though differently; and the best choice if you just want to make the accursed text readable
- drop them out β this is what both recode and cstocs can do (cstocs can also replace these characters by some fixed character instead of mere ignoring); useful when the to-be-omitted characters contain only noise.
Please consult your favourite converter manual for details of this issue. Generally, if you are not lucky enough to have all convertible characters in you file, manual intervention is needed anyway.
β Performance notes β
Poor performance of available converters has been one of main reasons for including built-in converter in enca. Try to use it whenever possible, i.e. when files in consideration are charset-clean enough or charset-messy enough so that its zero built-in intelligence doesn't matter. It requires no extra disk space nor extra memory and can outperform recode(1) more than 10 times on large files and Perl version (i.e. the faster one) of cstocs(1) more than 400 times on small files (in fact it's almost as fast as mere cp(1)).
Try to avoid external converters when it's not absolutely necessary since all the forking and moving stuff around is incredibly slow. π
π ENCODINGS π
okay so bestie, this is where we get into the actual tea β all the encodings and surfaces Enca knows about. stay with me, it's giving encyclopedia but make it cute π¦
You can get a whole list of recognised character sets with
enca --list charsets
and using the --name parameter you can pick literally any name you want to show up in that listing. iconic, honestly. You can also list all the surfaces with
enca --list surfaces
Encoding and surface names are case insensitive and non-alphanumeric characters just... don't count. BUT β and this is the plot twist β non-alphanumeric characters are mostly not allowed at all. The only ones that get a pass are: -, _, ., :, and / (which is the charset/surface separator). So ibm852 and IBM-852 are the same thing, but IBM 852 is a hard no and will not be accepted. periodt. π
πΈ Charsets πΈ
This following list of recognised charsets uses Enca's names (-e) and the verbal descriptions as reported by Enca (-f):
ASCIIβ 7bit ASCII charactersISO-8859-2β ISO 8859-2 standard; ISO Latin 2ISO-8859-4β ISO 8859-4 standard; Latin 4ISO-8859-5β ISO 8859-5 standard; ISO CyrillicISO-8859-13β ISO 8859-13 standard; ISO Baltic; Latin 7ISO-8859-16β ISO 8859-16 standardCP1125β MS-Windows code page 1125CP1250β MS-Windows code page 1250CP1251β MS-Windows code page 1251CP1257β MS-Windows code page 1257; WinBaltRimIBM852β IBM/MS code page 852; PC (DOS) Latin 2IBM855β IBM/MS code page 855IBM775β IBM/MS code page 775IBM866β IBM/MS code page 866balticβ ISO-IR-179; BalticKEYBCS2β Kamenicky encoding; KEYBCS2macceβ Macintosh Central Europeanmaccyrβ Macintosh CyrillicECMA-113β Ecma Cyrillic; ECMA-113KOI-8_CS_2β KOI8-CS2 code (T602)KOI8-Rβ KOI8-R CyrillicKOI8-Uβ KOI8-U CyrillicKOI8-UNIβ KOI8-Unified CyrillicTeXβ (La)TeX control sequencesUCS-2β Universal character set 2 bytes; UCS-2; BMPUCS-4β Universal character set 4 bytes; UCS-4; ISO-10646UTF-7β Universal transformation format 7 bits; UTF-7UTF-8β Universal transformation format 8 bits; UTF-8CORKβ Cork encoding; T1GBKβ Simplified Chinese National Standard; GB2312BIG5β Traditional Chinese Industrial Standard; Big5HZβ HZ encoded GB2312unknownβ Unrecognized encoding
where unknown is not a real encoding β it's what gets reported when Enca literally cannot give you a reliable answer. it's the shrug emoji of encodings π€·ββοΈ
β¨ Surfaces β¨
Enca has some experimental support for so-called surfaces (more on that below). It detects the following surfaces (and nope, not all of them can be applied to all charsets):
/CRβ CR line terminators/LFβ LF line terminators/CRLFβ CRLF line terminatorsN.A.β Mixed line terminatorsN.A.β Surrounded by/intermixed with non-text data/21β Byte order reversed in pairs (1,2 -> 2,1)/4321β Byte order reversed in quadruples (1,2,3,4 -> 4,3,2,1)N.A.β Both little and big endian chunks, concatenated/qpβ Quoted-printable encoded
ngl bestie, note that some surfaces have N.A. where the identifier should be β those ones cannot be specified on the command line, they can only ever be reported by Enca. This is fully intentional: they only tell you why a file can't be considered surface-consistent, instead of representing a real surface. π
Each charset has its natural surface (called implied in recode) which does not get reported β for example, for the IBM 852 charset it's CRLF line terminators. For UCS encodings, big endian is considered the natural surface; the unusual byte orders are constructed from 21 and 4321 permutations: 2143 is reported simply as 21, while 3412 is reported as a combination of 4321 and 21.
Doubly-encoded UTF-8 is neither charset nor surface β it's just reported. that's it, that's the whole vibe.
π¦ About charsets, encodings and surfaces π¦
okay so let's actually break this down, because the words get thrown around a lot:
A charset is a set of character entities, while an encoding is its representation in terms of bytes and bits. In Enca, the word encoding means the same as representation of text β i.e. the relation between the sequence of character entities constituting the text and the sequence of bytes (bits) constituting the file.
So an encoding is both the character set and the so-called surface (line terminators, byte order, combining, Base64 transformation, etc.). Nevertheless, it proves convenient to work with some {charset,surface} pairs as if they were genuine charsets. So, just like in recode(1), all UCS- and UTF- encodings of the Universal character set are called charsets. Please see the recode documentation for more details on this whole issue.
The only good thing about surfaces is: when you don't start playing with them, neither will Enca β it will try to behave as much as possible like a surface-unaware program, even when it's talking to recode. we love a low-maintenance bestie π
π LANGUAGES π
Enca needs to know the language of the input files to work reliably, at least in the case of regular 8bit encoding. Multibyte encodings should be recognised for any Latin, Cyrillic or Greek language.
You can (or honestly, have to) use the -L option to tell Enca the language. Since people most often work with files in the same language for which they have configured locales, Enca tries tries to guess the language by examining the value of LC_CTYPE and other locale categories (please see locale(7)) and using it for the language when you don't specify any.
π bestie, this can be completely wrong and will give you nonsense answers and damage your files, so please don't forget to use the -L option.
You can also use the ENCAOPT environment variable to set a default language (see section ENVIRONMENT).
The following languages are supported by Enca (each language is listed together with its supported 8bit encodings):
- Belarusian β
CP1251IBM866ISO-8859-5KOI8-UNImaccyrIBM855 - Bulgarian β
CP1251ISO-8859-5IBM855maccyrECMA-113 - Czech β
ISO-8859-2CP1250IBM852KEYBCS2macceKOI-8_CS_2CORK - Estonian β
ISO-8859-4CP1257IBM775ISO-8859-13maccebaltic - Finnish β
ISO-8859-4CP1257 - Croatian β
CP1250ISO-8859-2IBM852macceCORK - Hungarian β
ISO-8859-2CP1250IBM852macceCORK - Lithuanian β
CP1257ISO-8859-4IBM775ISO-8859-13maccebaltic - Latvian β
CP1257ISO-8859-4IBM775ISO-8859-13maccebaltic - Polish β
ISO-8859-2CP1250IBM852macceISO-8859-13ISO-8859-16balticCORK - Russian β
KOI8-RCP1251ISO-8859-5IBM866maccyr - Slovak β
CP1250ISO-8859-2IBM852KEYBCS2macceKOI-8_CS_2CORK - Slovene β
ISO-8859-2CP1250IBM852macceCORK - Ukrainian β
CP1251IBM855ISO-8859-5CP1125KOI8-Umaccyr - Chinese β
GBKBIG5HZ - none
The special language none can be shortened to __, it contains no 8bit encodings, so only multibyte encodings are detected. slay, minimalism π
You can also use locale names instead of languages:
- Belarusian β
be - Bulgarian β
bg - Czech β
cs - Estonian β
et - Finnish β
fi - Croatian β
hr - Hungarian β
hu - Lithuanian β
lt - Latvian β
lv - Polish β
pl - Russian β
ru - Slovak β
sk - Slovene β
sl - Ukrainian β
uk - Chinese β
zh
β FEATURES β
Several of Enca's features depend on what's available on your system and how it was compiled. You can get their list with
enca --version
A plus sign before a feature name means it's available, a minus sign means this build is lacking that particular feature. simple as that π
librecode-interfaceβ Enca has an interface to the GNU recode library charset conversion functions.iconv-interfaceβ Enca has an interface to UNIX98 iconv charset conversion functions.external-converterβ Enca can use external conversion programs (if you have some suitable ones installed).language-detectionβ Enca tries to guess the language (-L) from locales. You don't need the--languageoption, at least in principle.locale-aliasβ Enca is able to decrypt locale aliases used for language names.target-charset-autoβ Enca tries to detect your preferred charset from locales. The option--auto-convertand calling Enca asenconvworks, at least in principle.ENCAOPTβ Enca is able to correctly parse this environment variable before command line parameters. Simple stuff likeENCAOPT="-L uk"will work even without this feature.
π ENVIRONMENT π
- The variable
ENCAOPTcan hold a set of default Enca options. Its content is interpreted before command line arguments. Unfortunately, this doesn't work everywhere (you must have the+ENCAOPTfeature). LC_CTYPE,LC_COLLATE,LC_MESSAGES(possibly inherited fromLC_ALLorLANG) are used for guessing your language (you must have the+language-detectionfeature).- The variable
DEFAULT_CHARSETcan be used byenconvas the default target charset.
π DIAGNOSTICS π
Enca returns exit code 0 when all input files were successfully proceeded (i.e. all encodings were detected and all files were converted to the required encoding, if conversion was asked for).
Exit code 1 is returned when Enca wasn't able to either guess the encoding or perform conversion on any input file, because it's just not clever enough. π
Exit code 2 is returned in case of serious (e.g. I/O) troubles.
π₯ SECURITY π₯
It should be possible to let Enca work unattended β that's literally its goal. However:
- There's no warranty the detection works 100%. Don't bet on it, you can easily lose valuable data.
- Don't use
enca(the program), link tolibencainstead if you want anything resembling security. You have to perform the eventual conversion yourself then. - Don't use external converters. Ideally, disable them compile-time.
- Be aware of
ENCAOPTand all the built-in automagic guessing of various things from the environment, namely locales.
π«Ά bestie i'm being so serious rn, read that list twice. no cap.
πΈ SEE ALSO πΈ
autoconvert(1), cstocs(1), file(1), iconv(1), iconv(3), nl_langinfo(3), map(1), piconv(1), recode(1), locale(5), locale(7), ltt(1), umap(1), unicode(7), utf-8(7), xcode(1)
π KNOWN BUGS π
- It has too many unknown bugs. (yes, that's the actual bug report. iconic.)
- The idea of using
LC_*value for language is certainly braindead. However I like it. - It can't backup files before mangling them. π
- In certain situations, it may behave incorrectly on >31bit file systems and/or over NFS (both untested but shouldn't cause problems in practice).
- Built-in converter does not convert character
chfrom KOI8-CS2, and possibly some other characters you've probably never heard about anyway. - EOL type recognition works poorly on Quoted-printable encoded files. This should be fixed someday.
- There are no command line options to tune libenca parameters. This is intentional (Enca should DWIM) but sometimes this is a nuisance.
- The manual page is too long, especially this section. This doesn't matter since nobody does read it. (not me reading it tho π)
- Send bug reports to <https://github.com/nijel/enca/issues>.
π§ TRIVIA π§
Enca is Extremely Naive Charset Analyser. Nevertheless, the enc originally comes from encoding, so the leading e should be read as in encoding β not as in extreme. the more you know π«
π AUTHORS
Ok so who even made this masterpiece? Bestie, gather round, the girlies and the icons behind enca:
- David Necas (Yeti)
<yeti@physics.muni.cz>π - Michal Cihar
<michal@cihar.com>π
And a lil note on where the magic data comes from: Unicode data has been generated from various (free) on-line resources or using GNU recode. Statistical data has been generated from various texts on the Net β and the author says, and I quote, "I hope character counting doesn't break anyone's copyright." π such a mood, genuinely so real of them.
π«Ά ACKNOWLEDGEMENTS
Please see the file THANKS in distribution. β¨ That's it, that's the whole vibe β go read the THANKS file, it's giving appreciation era, it's giving gratitude.
π COPYRIGHT
Alright, the legal bit, but make it slay. Read it, it actually matters:
Copyright (C) 2000-2003 David Necas (Yeti).
Copyright (C) 2009 Michal Cihar <michal@cihar.com>.
Enca is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. π
Enca is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. π¨ No cap β the no-warranty thing is real and it means exactly what it says. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Enca; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
okay that's the whole page bestie, we did it, we ate and left no crumbs π β¨
This is from enca 1.11, dated Sep 2009 β and the page itself is enca(1). Obsessed with her fr fr. Go convert some encodings, queen ππ¦πΈ
π¦ where this page comes from
- arch rolling: enca 1.22-1 Β· GPL-2.0-only
- nixpkgs unstable: enca 1.22
- ubuntu resolute: enca 1.21-1 Β· GPL-2.0-only
- ubuntu stonking: enca 1.22-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms