[Qt-interest] How to check between "Text" and "Non-Text" File

Aaron Lewis aaron.lewis1989 at gmail.com
Tue Apr 20 10:30:43 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/20/2010 04:13 PM, Jeroen De Wachter wrote:
> Hey yogesh,
> 
> I don't know if you ever worked with the file command? Its sole purpose 
> is to classify files.
> Maybe you can get some ideas from the source code.

File command just reads the header of a file , and sometimes it can be
forged , but it's an common way to detect file types , like RAR:

Header Signature is `52 61 72 21' in hex , `Rar!' in ascii.

Generally speaking , there's no good way to check if the file is totally
plain text , but a single character.

Just as Frederic suggested , try bool QChar::isPrint()


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvNZjMACgkQvf41sEptMqARWACdFoJQO+Q2Ci0wxpTWpNgnKfvV
YPIAoKTzYwZmNuFU92gHrVH9pd/0/mis
=76o6
-----END PGP SIGNATURE-----



More information about the Qt-interest-old mailing list