How does UltraEdit detect a binary file?

This forum is user-to-user based and not regularly monitored by IDM.
Please see the note at the top of this page on how to contact IDM.

How does UltraEdit detect a binary file?

Postby jslarve » Thu Aug 17, 2006 6:59 pm

Hello -

I notice that when I open a binary file (such as a .gif) in Ultra Edit, it immediately goes into "hex" mode. Text files go into "standard" mode.

Are you willing to divulge what you're doing to determine the "binaryness" of a file?

It seems to make this decision very quickly.

Thank you.
User avatar
jslarve
Newbie
 
Posts: 4
Joined: Mon Apr 03, 2006 11:00 pm

Re: How does UltraEdit detect a binary file?

Postby Mofi » Fri Aug 18, 2006 5:22 am

I can also answer your question because it is explained in help of UltraEdit at the page Advanced (Configuration - Editor) at option

Allow editing of text files with HEX 00's without converting them to spaces
When a file is loaded the editor checks the first 3K of the file and if it contains more than one NULL (HEX 00) the file is considered a binary/HEX file.

I should add, if the file is not an Unicode file with or even without BOM. 2 NULL in sequence is for example not possible in an Unicode file, but nearly always exist in a binary file.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4042
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: How does UltraEdit detect a binary file?

Postby jslarve » Fri Aug 18, 2006 4:16 pm

To those interested in the response to tech support:

"Thanks for your message. I believe UltraEdit-32 looks for at least
three NULLS (HEX 00) within the first 7K of a file to determine if it's
a binary file."

This does seem to be it. The 2 nulls thing is no longer true.

Thanks for your help.
User avatar
jslarve
Newbie
 
Posts: 4
Joined: Mon Apr 03, 2006 11:00 pm

Re: How does UltraEdit detect a binary file?

Postby Mofi » Sat Aug 19, 2006 7:39 am

Aha, looks like the help must be updated. The 2 nulls in sequence was only supposed by me because Unicode files always contain nulls. I will report IDM, that they should update the help accordingly.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4042
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to UEStudio General Discussion