Lister : Mode detection error…

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Lister : Mode detection error…

Post by *Clo »

:) Hello !

• A short TXT-ANSI file containing only a few characters is detected as binary, while the automatic detection is set ON :

1. Just type i.e. ejgehaez in any editor, and save the file as i.e. test.txt (ANSI)
2. Ensure you that the automatic detection is ON in the Lister Configuration (first line at the top),
with also the “As configured for the current font” Encoding Menu item checked.
3. View the file in Lister, watch the Options Menu >> Binary is marked ! :P
- Opening that file in Universal Viewer or Notepad2 shows it as ANSI, of course …

:mrgreen: KR
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
fenix_productions
Power Member
Power Member
Posts: 1979
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Post by *fenix_productions »

2Clo
Other forum, thread number 4389.

The answer is:
ghisler(Author) wrote:Lister expects that there is at least one line break in the file, and no 00 characters (actually 00..05) in the file to be clearly a text file.
So.... this is the question for better "guessing algorithms" :)
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

#128099
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Hammer the nail

Post by *Clo »

2fenix_productions

:) Hello K. !
…So.... this is the question for better "guessing algorithms" :)
• Well, I just hammer the nail… You are right, and in the case, the file isn't empty, same result if a bit longer (10 characters…)
- That doesn't look nice while other viewers¦editors are able to detect TXT-ANSI from a few characters.

:mrgreen: KR
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
fenix_productions
Power Member
Power Member
Posts: 1979
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Post by *fenix_productions »

2Clo
I think the problem is in default settings. Other editors start with "text mode" by default and are trying to adapt to it. In the case of lister it may start with "binary" and try to detect other mode to switch to. If it fails we're staying with it.

I agree that current way is not always the best but I am not sure would it be better to have it work other way. We should answer the question is it more likely to have text files or binary ones shorter than one line / amount of bytes read in one go. Answer for such question should determine the way to follow.
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

#128099
Post Reply