ENCGUESS(1)

โœจ NAME โœจ

encguess โ€” guess character encodings of files. This is the encguess(1) page from the Perl Programmers Reference Guide, and bestie, it's here to help you figure out what encoding a file is living in. ๐Ÿ’–

๐ŸŒธ VERSION ๐ŸŒธ

Version info, preserved exactly: $Id: encguess,v 0.4 2023/11/10 01:10:50 dankogai Exp $.

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

encguess [switches] filename...

๐ŸŽ€ SWITCHES ๐ŸŽ€

  • -h โ€” show this message and exit. Slay. ๐Ÿ’…
  • -s โ€” specify a list of "suspect encoding types" to test, separated by either ":" or ",".
  • -S โ€” output a list of all acceptable encoding types that can be used with the -s param.
  • -u โ€” suppress display of unidentified types.

๐Ÿงช EXAMPLES ๐Ÿงช

  1. Guess encoding of a file named test.txt, using only the default suspect types. Easy.
encguess test.txt
  1. Guess the encoding type of a file named test.txt, using the suspect types "euc-jp,shiftjis,7bit-jis". Both of these are valid, bestie:
encguess -s euc-jp,shiftjis,7bit-jis test.txt
encguess -s euc-jp:shiftjis:7bit-jis test.txt
  1. Guess the encoding type of several files, do not display results for unidentified files. Iconic multi-file behavior. โœจ
encguess -us euc-jp,shiftjis,7bit-jis test*.txt

๐Ÿ’… DESCRIPTION ๐Ÿ’…

The encoding identification is done by checking one encoding type at a time until all but the right type are eliminated. That's the whole strategy, no cap. ๐Ÿ•ต๏ธโ€โ™€๏ธ

The set of encoding types to try is defined by the -s parameter and defaults to ascii, utf8 and UTF-16/32 with BOM. This can be overridden by passing one or more encoding types via the -s parameter.

If you need to pass in multiple suspect encoding types, use a quoted string with the a space separating each value. Yes, that's the wording โ€” keep it cute and keep it exact. ๐ŸŽ€

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

Encode::Guess, Encode::Detect โ€” go give them a little look. ๐Ÿ‘€

Copyright 2015 Michael LaGrasta and Dan Kogai.

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License (2.0). You may obtain a copy of the full license at:

<http://www.perlfoundation.org/artistic_license_2_0>


Page source/version check: perl v5.42.3, dated 2026-11-03. Bye bestie, go guess those encodings! ๐Ÿซถ๐Ÿ’–

๐Ÿ“ฆ where this page comes from