dankogai / p5-encode

Encode - character encodings (for Perl 5.8 or better)
https://metacpan.org/release/Encode
37 stars 51 forks source link

Add encguess CLI example to README.md #33

Closed mcandre closed 9 years ago

mcandre commented 9 years ago

Now that the awesome encguess command line wrapper is available, could we add a quick example to the README?

dankogai commented 9 years ago

I have refactored it so that with '-h' or without arguments it shows quick help:

Usage:
      encguess [switches] filename...

  Switches:
    -s
      specify a list of "suspect encoding types" to test, seperated 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:
    * Guess encoding of a file named "test.txt", using only the default
      suspect types.

         encguess test.txt

    * Guess the encoding type of a file named "test.txt", using the suspect
      types "euc-jp,shiftjis,7bit-jis".

         encguess -s euc-jp,shiftjis,7bit-jis test.txt
         encguess -s euc-jp:shiftjis:7bit-jis test.txt

    * Guess the encoding type of several files, do not display results for
      unidentified files.

         encguess -us euc-jp,shiftjis,7bit-jis test*.txt

And the long help is also available via perldoc encguess.

Dan the Maintainer Thereof