Opened 16 years ago
Closed 8 years ago
#3065 closed bug (fixed)
[StyledEdit] Bad argument type passed to function
Reported by: | diver | Owned by: | korli |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications/StyledEdit | Version: | R1/pre-alpha1 |
Keywords: | Cc: | barzakouski@… | |
Blocked By: | #9395 | Blocking: | |
Platform: | All |
Description
StyledEdit can't open isolinix/f1.txt from mounted Ubuntu 8.10 cd.
Error is:
Error loading "f1.txt": Bad argument type passed to function
cat /Ubuntu\ 8.10\ 386/isolinix/f1.txt
shows file content, but doesn't exit itself, I have to hit return to go back to bash.
Attachments (3)
Change History (20)
comment:1 by , 16 years ago
Summary: | [StyledEdit] Bad argument type passed to function → [StyledEdit] Bad argument type passed to function (easy) |
---|
comment:2 by , 16 years ago
comment:3 by , 16 years ago
In fact, using "file f1.text" on Linux doesn't recognize the file as ASCII text but only data.
comment:5 by , 14 years ago
Cc: | added |
---|
comment:6 by , 14 years ago
Current (as of hrev38300) error is "Error loading f1.txt Unsupported format" which is more correct. I've just tried several linux editors (Kate, Kedit, Kwrite, Gedit) and all of them open this file ok, replacing non ASCII characters with different symbols..
by , 14 years ago
comment:7 by , 14 years ago
BTW, after displaying "Error loading f1.txt" StyledEdit opens with empty untitled window.
comment:8 by , 14 years ago
Hi, I tried to look into this problem a bit and it seems that the StyledText translator doesn't recognize this file as an ascii file because it contains special characters like 0x19, 0x14, 0x15 and 0x17.
This file, as already stated, is not recognized by the linux "file" utility as an ascii text file, but as data, so the translator is right in not considering it an ascii file it seems.
It's also true that most of text editors around show the content of the files even if it isn't a perfectly pure ascii file, and probably StyledEdit should do that too (maybe showing a warning message).
I've made a patch to StyledEdit that should make clear the idea I'm talking about (it's my first haiku patch, so please be kind to me :p )
Marcello
comment:9 by , 14 years ago
patch: | 0 → 1 |
---|
comment:10 by , 14 years ago
I leave the competent review to our experienced devs, just this much: you forgot to include the declaration of bool fDiscardFakeChanged;
in StyledEditWindow.h in your patch. Also always generate a patch from trunk/
. Lastly, respect the 80 char width rule.
Apart from that, I can confirm that with your patch the example file does indeed open in StyledEdit. I have set the "patch" flag with this ticket, in the hopes that when you've uploaded an updated patch someone has a look and applies it.
Thanks very much, Marcello!
comment:11 by , 14 years ago
Thank you :)
Tomorrow I will post a patch that will follow your suggestions.
by , 14 years ago
Attachment: | styled_patch2.patch added |
---|
comment:12 by , 14 years ago
I attached the corrected patch (I hope everything is ok now), but I made a mess with the attachment system. I wanted to attach the uncompressed patch, but ended up attaching the wrong version, and while trying to see if there was a way to remove it I accidentally uploaded it a second time :p
comment:13 by , 13 years ago
Summary: | [StyledEdit] Bad argument type passed to function (easy) → [StyledEdit] Bad argument type passed to function |
---|
Removing the '(easy)' from the title of this ticket, since this causes it to be shown in the list of tickets for people who want to start working on Haiku, and it's now just waiting for review, really.
comment:15 by , 12 years ago
Blocked By: | 9395 added |
---|
comment:17 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The file contains non ASCII characters. What should we do with it ? Should we accept text files containing like 90% of ASCII characters ?
About the cat which doesn't exit, it does. The file simply doesn't contain a new line at the end of the file.