| View previous topic :: View next topic |
| Author |
Message |
Clo Moderator


Joined: 02 Dec 2003 Posts: 5737 Location: Bordeaux, France
|
Posted: Sat Sep 12, 2009 9:32 pm Post subject: Lister : Mode detection error… |
|
|
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 !
- Opening that file in Universal Viewer or Notepad2 shows it as ANSI, of course …
KR
Claude
Clo _________________ #31505 Traducteur Français de T•C French translator Aide en Français Tutoriels Français English Tutorials |
|
| Back to top |
|
 |
fenix_productions Power Member


Joined: 07 Aug 2005 Posts: 1881 Location: Poland
|
Posted: Sun Sep 13, 2009 1:09 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Clo Moderator


Joined: 02 Dec 2003 Posts: 5737 Location: Bordeaux, France
|
Posted: Sun Sep 13, 2009 1:53 am Post subject: Hammer the nail |
|
|
2fenix_productions
Hello K. !
| Quote: | …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.
KR
Claude
Clo _________________ #31505 Traducteur Français de T•C French translator Aide en Français Tutoriels Français English Tutorials |
|
| Back to top |
|
 |
fenix_productions Power Member


Joined: 07 Aug 2005 Posts: 1881 Location: Poland
|
Posted: Sun Sep 13, 2009 2:37 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
|