Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12976 closed bug (fixed)

StyledEdit Cannot Open Some text files

Reported by: vidrep Owned by: pulkomandy
Priority: normal Milestone: Unscheduled
Component: Applications/StyledEdit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Updated from hrev50551 x86_gcc2 to hrev50559 Some text files now can not be opened in StyledEdit (they do open with Pe) "error loading "xxxx.txt": Unsupported format" I have attached a pair of samples

Attachments (4)

BeOS Games.txt (173 bytes ) - added by vidrep 8 years ago.
HD5450.txt (172 bytes ) - added by vidrep 8 years ago.
screenshot2.png (591.9 KB ) - added by kim1963 8 years ago.
Haiku Donations.txt (1016 bytes ) - added by vidrep 8 years ago.

Download all attachments as: .zip

Change History (21)

by vidrep, 8 years ago

Attachment: BeOS Games.txt added

by vidrep, 8 years ago

Attachment: HD5450.txt added

comment:1 by pulkomandy, 8 years ago

Owner: changed from axeld to pulkomandy
Status: newin-progress

comment:2 by kim1963, 8 years ago

hrev50555

"error loading "xxxx.txt": Unsupported format"

comment:3 by pulkomandy, 8 years ago

Both files open fine here.

Please check the output of catattr be:encoding /boot/home/Desktop/HD5450.txt and listattr.

comment:4 by vidrep, 8 years ago

New text files created with hrev50559 also cannot be opened, with same error message. I'll provide your requested info shortly.

comment:5 by vidrep, 8 years ago

Welcome to the Haiku shell.

~> catattr be:encoding /boot/home/HD6450.txt /boot/home/HD6450.txt : int32 : 65535 ~> listattr be:encoding /boot/home/HD6450.txt listattr: initialization failed for "be:encoding": No such file or directory ~>

by kim1963, 8 years ago

Attachment: screenshot2.png added

comment:7 by pulkomandy, 8 years ago

listattr is run with just the file name, no attribute name.

Anyway, the be:encoding should be a string if created by StyledEdit. So I need to know the exact process you used to create these files, to understand how they end up with an integer be:encoding (that is an old way to do it, from BeOS days). Moreover, the value stored in the attribute is the special value for "unknown" encoding. I should probably make StyledEdit ignore this specific value and re-do the detection from the text contents.

comment:8 by vidrep, 8 years ago

Welcome to the Haiku shell.

~> listattr /boot/home/HD6450.txt File: /boot/home/HD6450.txt

Type Size Name


Int-32 4 "be:encoding"

MIME String 11 "BEOS:TYPE"

Int-32 4 "wrap" Int-32 4 "alignment"

Raw Data 160 "styles"

'RECT' 16 "StyledEdit-info" Int-32 4 "be:caret_position" 'info' 529 "pe-info"

732 bytes total in attributes. ~>

Version 0, edited 8 years ago by vidrep (next)

comment:9 by jackburton, 8 years ago

Since that commit, StyledEdit also seem to fail to open some rdef files.

comment:10 by vidrep, 8 years ago

I did a comparision of texts that fail to open vs ones that don't. The commonality in the failed texts is the text encoding - Unicode (UTF8).

comment:11 by pulkomandy, 8 years ago

Please try again with hrev50562 or later. Fixed some issues here but I'm not sure I caught all cases.

comment:12 by vidrep, 8 years ago

I tried a bunch of text files with different encoding and all seem to work now. If a non-working example pops up we can reopen the ticket. Thanks!

comment:13 by pulkomandy, 8 years ago

Resolution: fixed
Status: in-progressclosed

comment:14 by diver, 8 years ago

Thanks! Works great now :)

comment:15 by vidrep, 8 years ago

Still some issues here: I created a document with GoBe Word Processing and saved it in text format. When opened with StyledEdit the document is blank I can open it with Pe and see the contents without issue I have attached the document in question.

by vidrep, 8 years ago

Attachment: Haiku Donations.txt added

comment:16 by vidrep, 8 years ago

In order to get a list of attributes I shortened the name to Donations.txt

~> listattr Donations.txt
File: Donations.txt
        Type       Size  Name                                
----------------------------------------------------------
 MIME String        11  "BEOS:TYPE"
      Int-32         4  "alignment"
    Raw Data       160  "styles"
        Text         5  "be:encoding"
      'RECT'        16  "StyledEdit-info"
      Int-32         4  "be:caret_position"
      'info'       529  "pe-info"

729 bytes total in attributes.
~> catattr be:encoding /boot/home/Donations.txt
/boot/home/Donations.txt : string : UTF-8
~> 
Last edited 8 years ago by humdinger (previous) (diff)

comment:17 by humdinger, 8 years ago

JFYI, with listattr -l you'll also get the contents of the attributes. Saves you the cumbersome catattr line. :)

Note: See TracTickets for help on using tickets.