GNOME Bugzilla – Bug 355477
Snippet Plugin: Multibyte Charactors As $GEDIT_BASENAME Not Displayed Correctly
Last modified: 2019-03-23 20:46:42 UTC
Please describe the problem: When I use multibyte letters as $GEDIT_BASENAME (in my case, Japanese) in Snippet plugin, a series of hexadecimal numbers (e.g. %E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%90%8D) is displayed when I use the Snippet. $GEDIT_FILENAME works just fine. Steps to reproduce: 1. Open Gedit 2. Add a Snippet that contains $GEDIT_BASENAME 3. Save a file in multibyte letters (e.g. "ファイル名" ("filename" in Japanese)) 4. Use the Snippet Actual results: In the case above, "%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%90%8D", not "ファイル名", is displayed. When I use $GEDIT_FILENAME, "/home/username/Desktop/ファイル名" is displayed just right. Expected results: "ファイル名" is displayed. Does this happen every time? Yes. Other information:
I've been looking in to the problem and I think I know how to properly fix it. But there also seems to be a bit of a problem in gnomevfs which causes the uri not to be converted to utf-8 properly for remote schemes (Not sure what version of gedit/gnomevfs you're using, but have a look at the tooltip of the document on the notebook tab). We're working at solving the problem asap.
Thanks for your reply. It seems I'm using the following versions on Fedora Core 5: - gnome-vfs2 2.14.2-1 (not sure this is what you meant by "gnomevfs") - gedit 2.14.3 Keep up the great work!
Created attachment 73284 [details] [review] Fix format uri for display This patch adds functionality to gedit_utils_format_uri_for_display to manually try to unescape remote uri's testing it for valid utf-8. I'm not sure from what encodings to try to convert from (what does windows use?) from. Currently it first checks if it's already valid utf-8 (after unescaping) and if not it tries to convert from ISO-8859-15.
I just want to add that the same thing happened with $GEDIT_CURRENT_DOCUMENT_NAME in the external tools plugin ($GEDIT_CURRENT_DOCUMENT_PATH worked fine). http://live.gnome.org/Gedit/ToolLauncherPlugin
Created attachment 76472 [details] [review] Fix basename envvar Now that gedit utils is fixed (and therefore uri_for_display on gedit.Doc), we can fix this issue by the proposed patch, any comments?
Fixed in HEAD