! 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 !
UTF-8 filename doesn't open
Status:
RESOLVED: FIXED
Product:
Mousepad
Component:
General

Comments

Description Renato Santos 2015-06-26 22:08:32 CEST
The mousepad (version 0.4.0) does not open when I try to open a text file that is in a folder with accents.

[ p0ng   ~ > ~/aááálá ] mousepad êita\ poxá.txt 
process 1832: arguments to dbus_message_iter_append_basic() were incorrect, assertion "_dbus_check_is_valid_utf8 (*string_p)" failed in file dbus-message.c line 2676.
This is normally a bug in some application using the D-Bus library.
  D-Bus not built with -rdynamic so unable to print a backtrace
Aborted (core dumped)


In this case, the mousepad opens (the name in UTF-8 format)

[ p0ng   ~ > ~/Estágio ] mousepad teste.sh 
[ p0ng   ~ > ~/Estágio ] 


My system is setted in iso-8859-1 (or at least should be)

[ p0ng   ~ > ~ ] locale -a
C
en_US.iso88591
POSIX
[ p0ng   ~ > ~ ] locale
LANG=en_US.ISO-8859-1
LC_CTYPE="en_US.ISO-8859-1"
LC_NUMERIC="en_US.ISO-8859-1"
LC_TIME="en_US.ISO-8859-1"
LC_COLLATE="en_US.ISO-8859-1"
LC_MONETARY="en_US.ISO-8859-1"
LC_MESSAGES="en_US.ISO-8859-1"
LC_PAPER="en_US.ISO-8859-1"
LC_NAME="en_US.ISO-8859-1"
LC_ADDRESS="en_US.ISO-8859-1"
LC_TELEPHONE="en_US.ISO-8859-1"
LC_MEASUREMENT="en_US.ISO-8859-1"
LC_IDENTIFICATION="en_US.ISO-8859-1"
LC_ALL=


Thanks in advance!
Comment 1 Matthew Brush editbugs 2015-06-27 02:13:41 CEST
I don't think Mousepad gives any special treatment for filenames (except for GUI display maybe). It seems to use GLib's option parser to get the filenames, then it blindly passes them through to the various GLib functions, which is the right thing to do.

What are the exact bytes you're using in your filename? I want to be sure our browsers, bugzillas, terminals, etc are not munging the bytes. You can find the byte numbers here:

https://en.wikipedia.org/wiki/ISO/IEC_8859-1#Codepage_layout
Comment 2 Matthew Brush editbugs 2015-06-27 02:23:21 CEST
It might be this:

http://git.xfce.org/apps/mousepad/tree/mousepad/mousepad-dbus.c#n321

If DBus requires UTF-8 and Mousepad is feeding it the arguments in your locale encoding.
Comment 3 Matthew Brush editbugs 2015-06-27 03:07:29 CEST
Created attachment 6339 
Encode filenames passed to DBus as UTF-8

Are you able to test this patch against Git master branch?
Comment 4 Renato Santos 2015-06-27 04:52:12 CEST
Created attachment 6340 
Screenshot

Now it works!! Attached screenshot showing file correctly recognized.
Comment 6 Matthew Brush editbugs 2015-06-27 05:25:51 CEST
Do you mind testing this commit?

http://git.xfce.org/apps/mousepad/commit/?id=ee7636b8c832f2a8e19c6b3c9d0405f07147b16b

My locale encoding is UTF-8 so I'm not sure it's a good test.

It just improves the code/speed of previous commit.
Comment 7 Renato Santos 2015-06-27 07:18:06 CEST
It worked in the same way! 

- 'git clone' in a new directory
- sh autogen.sh
- cd mousepad/mousepad
- ./mousepad /home/p0ng/trálálá/lá.txt

And...

(mousepad:14926): GLib-GObject-WARNING **: The property GtkSettings:gtk-menu-images is deprecated and shouldn't be used anymore. It will be removed in a future version.

(mousepad:14926): Gtk-CRITICAL **: gtk_recent_manager_lookup_item: assertion 'GTK_IS_RECENT_MANAGER (manager)' failed

(mousepad:14926): GLib-GObject-WARNING **: The property GtkButton:use-stock is deprecated and shouldn't be used anymore. It will be removed in a future version.

(mousepad:14926): GLib-GObject-WARNING **: The property GtkSettings:gtk-button-images is deprecated and shouldn't be used anymore. It will be removed in a future version.

Only warning messages.

Thanks for the quick help! :)

Bug #12021

Reported by:
Renato Santos
Reported on: 2015-06-26
Last modified on: 2015-06-27

People

Assignee:
Matthew Brush
CC List:
2 users

Version

Attachments

Encode filenames passed to DBus as UTF-8 (2.89 KB, patch)
2015-06-27 03:07 CEST , Matthew Brush
no flags
Screenshot (937.08 KB, image/png)
2015-06-27 04:52 CEST , Renato Santos
no flags

Additional information