Ciao, Piviul wrote: > Ciao a tutti, sto cercando un comando per poter sapere il charset di un > file. Ho provato file ma mi risponde text sia che sia un UTF-8 che in > ISO8859-x. Qualcuno è a conoscenza di un software che sia in grado di > dirmi la codifica di un file? Strano a me file versine 5.03 dà questa informazione. Sembrerebbe che con il flag -i l'informazione sul charset sia più specifica:
~/Desktop/test$ echo "èéòàì" > utf_file ~/Desktop/test$ echo "abcde" > ascii_file ~/Desktop/test$ iconv -f UTF-8 -t ISO_8859-2//TRANSLIT utf_file --output iso_file ~/Desktop/test$ file * ascii_file: ASCII text iso_file: ISO-8859 text utf_file: UTF-8 Unicode text ~/Desktop/test$ file -i * ascii_file: text/plain; charset=us-ascii iso_file: text/plain; charset=iso-8859-1 utf_file: text/plain; charset=utf-8 Lorenzo. > Grazie > > Piviul > > -- Per REVOCARE l'iscrizione alla lista, inviare un email a [email protected] con oggetto "unsubscribe". Per problemi inviare un email in INGLESE a [email protected] To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected] Archive: http://lists.debian.org/[email protected]

