CHARDETECT(1)
π CHARDETECT β the manual page, but make it cute π
okay so bestie, gather round, because chardetect is literally the little tool that looks at a file and goes "hmm, what encoding is this giving?" π¦ It's a User Commands page, one of the classics, and I'm gonna walk you through every single flag because you deserve to know all of them. no gatekeeping here, periodt.
β¨ NAME β¨
chardetect β takes one or more file paths and reports their detected encodings π
like. it sniffs the vibes of your bytes and tells you what character encoding they're serving. that's the whole job and it ate.
πΈ SYNOPSIS πΈ
chardetect [-h] [--minimal] [-l] [-e ENCODING_ERA] [--version]
[input ...]
yes the line wraps, no you don't need to type it on two lines, she's just cozy like that π
π OPTIONS π
π POSITIONAL ARGUMENTS
inputβ File whose encoding we would like to determine. (default:stdin)
so you can hand her as many file paths as your heart desires, or hand her nothing and she'll read from stdin instead. no files? no problem. she's flexible like that. π
π§ OPTIONAL ARGUMENTS
-h,--helpβ Show a help message and exit.
the classic. the icon. she explains herself and then dips. π
--minimalβ Print only the encoding to standard output.
no extra chatter, no commentary, just the encoding and nothing else. perfect for when you're piping her into something else and you don't want her yapping. lowkey the most useful flag for scripting, ngl. β¨
-l,--legacyβ Rename legacy encodings to more modern ones.
so if she detects an old-school encoding, this flag lets her report it under its newer, more modern name instead. glow-up for encodings, fr fr. π
-e,--encoding-era ENCODING_ERAβ Which era of encodings to consider (default:MODERN_WEB).
okay this one's the main character π β you get to tell her which era of encoding history she should be looking at. and the choices are:
MODERN_WEBLEGACY_ISOLEGACY_MACLEGACY_REGIONALDOSMAINFRAMEALL
like she will literally time-travel through encoding eras for you. MODERN_WEB is the default because obviously, we live in the now, but if you've got some ancient DOS-era file lurking in your directory she can absolutely go there. π
--versionβ Show program's version number and exit.
she tells you who she is and then leaves. main character exit. π«Ά
π« A LIL NOTE π«
real talk: nothing here is dangerous or deprecated, she's just a sweet little detector doing her best. hand her files, get encodings. that's the vibe check and she passes it every time. β
and that's the whole page, bestie!! π you now know literally every flag, every default, every choice, and every argument. go forth and detect encodings, you absolute legend. π¦β¨
this page came from the User Commands manual, dated February 2026 β CHARDETECT(1), forever iconic, no cap. ππ
π¦ where this page comes from
- fedora 44: python3-chardet 6.0.0.post1-1.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms