! 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 !
Cannot set wallpaper with utf8 file paths in CLI
Status:
RESOLVED: FIXED
Product:
Xfconf
Component:
Xfconf-query

Comments

Description hk2717 2008-11-16 08:57:19 CET
For example, if path to my wallpaper contain Chinese or Japanese characters, I cannot set wallpaper in command line with the following command:

    xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s ~/pic/wall/y.叶/3.jpg

But if it does not contain Chinese character, I can properly set the wallpaper:

    xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s ~/pic/wall/Vladstudio.1/1920vladstudio_1011.jpg

On the other hand, if I manually enter the file path in xfconf GUI. It works. No matter it contains Chinese character or not.

Also, I cannot set wallpaper that has Chinese characters in its path with thunar wallpaper plugin. I guess it is caused by this bug of xfconf.
Comment 1 Stephan Arts editbugs 2008-11-17 22:10:14 CET
xfce@xfce-laptop:~/svn-repo/xfconf/trunk/xfconf-query$ xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s ~/pic/wall/y.叶/3.jpg
option parsing failed: Invalid byte sequence in conversion input


you mean like that?
Comment 2 Stephan Arts editbugs 2008-11-17 22:15:34 CET
Could you test revision 28840?
Comment 3 Brian J. Tarricone (not reading bugmail) 2008-11-18 03:20:53 CET
Hmm, I'm not sure that that will fix the problem... or even if it does, it's not the whole problem.  Paths and such should be stored in utf8 in the xfconf store, and should probably be converted from the locale encoding (or filesystem encoding?) when typed on the commandline.  Apps that use paths from xfconf should convert them back into the filesystem encoding before using them.
Comment 4 lh 2009-02-06 13:50:46 CET
i have the same problem

xfconf-svn 29428
xfdesktop-svn 19430
thunar-svn 29417

i'll update it every day
Comment 5 Mike Massonnet editbugs 2009-02-18 21:40:49 CET
Created attachment 2180 
set the locale

Add a call to:
setlocale (LC_ALL, "");

before calling xfce_textdomain() which only sets the translation domain, not the locale.
Comment 6 Brian J. Tarricone (not reading bugmail) 2009-02-18 21:53:00 CET
Need a configure check for setlocale(), unless just wrapping that call in the HAVE_LOCALE_H ifdef is enough.

Also should wrap both of those in an ENABLE_NLS ifdef.  Otherwise things break...
Comment 7 Mike Massonnet editbugs 2009-02-18 22:11:18 CET
Created attachment 2181 
set the locale2

Patch updated! I'm not sure for ENABLE_NLS (i don't know what it is), tho setlocale() is surrounded with it in the patch.

Also, I did something else, that is scratching the #include <glib/i18n.h> stuff as this is done with libxfce4util.
Comment 8 Mike Massonnet editbugs 2009-02-18 22:13:00 CET
I didn't notice, but the AC_CHECK_FUNCS is commented.
Comment 9 Nick Schermer editbugs 2009-02-19 07:38:54 CET
I think this is the wrong approach. We should do proper name encoding using g_filename_to_utf8/g_locale_to_utf8 and store the utf-8 name in xfconf. Xfdesktop should read the xfconf name and use g_filename_from_utf8/g_locale_from_utf8 and use the locale filename to read the wallpaper.
Comment 10 Mike Massonnet editbugs 2009-02-19 08:03:27 CET
(In reply to comment #9)
> I think this is the wrong approach.

It's not.
Comment 11 Stephan Arts editbugs 2009-02-20 18:59:42 CET
I have committed the patch in revision 29522.

Nick has a point though, he could be on to a second part of this bug. Though it could be glib-dbus does the utf8 conversion for us.
Comment 12 Steve Dodier-Lazaro editbugs 2015-02-16 20:43:53 CET
I'm marking this report as fixed, since the patch was pushed and noone complained in years about an issue still occurring.

Bug #4622

Reported by:
hk2717
Reported on: 2008-11-16
Last modified on: 2015-02-16

People

Assignee:
Stephan Arts
CC List:
4 users

Version

Version:
4.5.92 (4.6beta2)

Attachments

set the locale (662 bytes, patch)
2009-02-18 21:40 CET , Mike Massonnet
no flags
set the locale2 (1.43 KB, patch)
2009-02-18 22:11 CET , Mike Massonnet
no flags

Additional information