! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Refuses to open files where the character encoding is not recognized
Status:
RESOLVED: MOVED
Product:
Mousepad
Component:
General

Comments

Description mlvrrkiyeq8 2019-03-02 14:02:31 CET
When I'm trying to open an ascii text file that has a few corrupt characters, Mousepad refuses to open the file and insists that the user select the correct character encoding.

The desired behavior (used by many other text editors) is to open the slightly corrupt file for editing and display a special symbol where the characters have not been recognized using the current character encoding. A warning stating the character encoding was not recognized would be helpful but should not prevent Mousepad from working.
Comment 1 scootergrisen 2019-06-10 14:14:08 CEST
The "The document was not UTF-8 valid" dialog have options to select what encoding you want to open the file with but it seems no matter what is selected the OK button is always disabled.

There is a big text area below "Invalid byte sequence in conversion input" but this text area seems to always be empty.

So i am guessing that something fails when Mousepad tries to show something in the text area and that the OK button is not enabled until the text area is filled.

Maybe Mousepad needs something else to be installed that is not installed? Like some converter software.

But i think i would just prefer Mousepad to display the file.
It would be annoying to have to select encoding each time you open a file.
Just open the file and let the user see the file.
Comment 2 Matthew Brush editbugs 2019-06-10 16:32:08 CEST
Is it possible the files are not text files and contain embedded NUL (0) bytes?

If you want to attach a file that triggers this, I could have a look in a hex file viewer.
Comment 3 scootergrisen 2019-06-10 16:35:55 CEST
I tried opening mo files.
Can be found in /usr/share/locale/[LL]/LC_MESSAGES

If Mousepad is suppose to fail/not open mo files and other files like that i guess its ok but i often like to open such files in a text editor to find a string.
Comment 4 Matthew Brush editbugs 2019-06-11 06:07:26 CEST
As far as I know Mousepad only supports opening text files right now. It might be possible to make it read other types of files and display them specially, but it might not fit well with Mousepad being a simple text editor.

There are some nice hex editors for Linux which will no doubt open those files and even allow viewing and editing the strings in them.
Comment 5 scootergrisen 2019-06-11 15:25:50 CEST
I guess i would like to open files with the default applications not having to install extra stuff. Even if the content is not shown correctly.

I tried opening a none UTF-8 text file and now the OK button is enable if i select something i Other:.
Maybe the error message could be improved and somehow tell the user why the application is refusing to open the file.
"Invalid byte sequence in conversion input" and disabled OK button does not really tell me why the program will not open the file.

If the title of the dialog is document is not valid UTF-8 then it sounds like the application is only made for opening UTF-8 encoded files.
So maybe all the text in the dialog could be written better like maybe unknown encoding or unable to detect encoding?
Comment 6 Git Bot editbugs 2020-05-24 01:31:15 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/mousepad/-/issues/28.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #15165

Reported by:
mlvrrkiyeq8
Reported on: 2019-03-02
Last modified on: 2020-05-24

People

Assignee:
Matthew Brush
CC List:
2 users

Version

Target Milestone:
Mousepad 0.4.x

Attachments

Additional information