Opened 3 years ago

Closed 3 years ago

Last modified 3 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:
Has a Patch: no 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 3 years ago.
HD5450.txt (172 bytes) - added by vidrep 3 years ago.
screenshot2.png (591.9 KB) - added by kim1963 3 years ago.
Haiku Donations.txt (1016 bytes) - added by vidrep 3 years ago.

Download all attachments as: .zip

Change History (21)

Changed 3 years ago by vidrep

Attachment: BeOS Games.txt added

Changed 3 years ago by vidrep

Attachment: HD5450.txt added

comment:1 Changed 3 years ago by pulkomandy

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

comment:2 Changed 3 years ago by kim1963

hrev50555

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

comment:3 Changed 3 years ago by pulkomandy

Both files open fine here.

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

comment:4 Changed 3 years ago by vidrep

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

comment:5 Changed 3 years ago by vidrep

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 ~>

Changed 3 years ago by kim1963

Attachment: screenshot2.png added

comment:7 Changed 3 years ago by pulkomandy

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 Changed 3 years ago by vidrep

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.
~> 
Last edited 3 years ago by pulkomandy (previous) (diff)

comment:9 Changed 3 years ago by jackburton

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

comment:10 Changed 3 years ago by vidrep

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 Changed 3 years ago by pulkomandy

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

comment:12 Changed 3 years ago by vidrep

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 Changed 3 years ago by pulkomandy

Resolution: fixed
Status: in-progressclosed

comment:14 Changed 3 years ago by diver

Thanks! Works great now :)

comment:15 Changed 3 years ago by vidrep

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.

Changed 3 years ago by vidrep

Attachment: Haiku Donations.txt added

comment:16 Changed 3 years ago by vidrep

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 3 years ago by humdinger (previous) (diff)

comment:17 Changed 3 years ago by humdinger

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.