[openbeos] Identifying Text Files

  • From: Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>
  • To: OBOS <openbeos@xxxxxxxxxxxxx>
  • Date: Thu, 08 Jun 2006 21:47:11 +0200

Howdy,

since BeOS seems to have built-in support for recognizing files as text 
files, we want to have the same. I'm about to implement that, missing is 
basically the algorithm deciding whether (or with what probability) a 
buffer of bytes actually contains text.

A simple but maybe a bit ignorant approach would be to check whether the 
buffer contains valid UTF-8 characters only (or more than, say, 95%). But 
maybe someone has better ideas...

CU, Ingo

Other related posts: