After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676916 - Filename garbled when you save .xcf.bz2 or .xcf.gz files using non-ASCII characters
Filename garbled when you save .xcf.bz2 or .xcf.gz files using non-ASCII char...
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.8.0
Other Windows
: Normal normal
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2012-05-27 04:55 UTC by Hayata Wakamoto
Modified: 2012-05-31 17:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use g_open() and g_fopen() instead of libc (3.88 KB, patch)
2012-05-28 08:56 UTC, Mukund Sivaraman
none Details | Review
proposed patch (1.60 KB, patch)
2012-05-30 15:55 UTC, Massimo
none Details | Review

Description Hayata Wakamoto 2012-05-27 04:55:59 UTC
Has been garbled to check the file name in Windows Explorer after you save a file bz2 or gz files using non-ASCII characters.

Yes there is a problem in Windows when using file-compressor plug-in.

Can be read from the history of GIMP even though garbled.

But from the drag & drop or "open" does not load with an error.

Exsample:

1. Saved in "名称未設定.xcf.bz2".
2. Check the file name in Windows Explorer.
3. Has become "蜷咲ァー譛ェ險ュ螳・xcf.bz2" File name.
Comment 1 André Klapper 2012-05-27 14:54:40 UTC
Which version of Windows is this about?

> Yes there is a problem in Windows when using file-compressor plug-in.

How is that related to the problem here? What do you mean by that?
Comment 2 Michael Schumacher 2012-05-27 17:22:16 UTC
Joji, does the same happen if you save an uncompressed XCF file?
Comment 3 Jernej Simončič 2012-05-27 18:21:13 UTC
Confirmed - file-compressor calls gzopen/BZ2_bzopen with the utf8-encoded filename, while these functions expect the codepage encoding (which means that they can't be used directly on Windows).
Comment 4 Mukund Sivaraman 2012-05-28 08:56:12 UTC
Created attachment 215116 [details] [review]
Use g_open() and g_fopen() instead of libc

I haven't tested this patch at all. It merely builds on Linux. No time for that right now. I'd appreciate if someone checks if it builds under win32. Specifically, I'm not sure if fcntl.h is available on win32 and if the macros to open() are accepted. I've used a number avoiding macros for the file mode bits as I think these are not available in the Windows environment.
Comment 5 Michael Natterer 2012-05-28 11:53:33 UTC
If it works fine on linux, please push, that's the fastest ways of getting
it fixed for windows.
Comment 6 Mukund Sivaraman 2012-05-28 15:14:41 UTC
Pushed to gimp-2-8 branch:

* e608b47 file-compressor: Bug #676916 - Use g_open() and g_fopen() instead of libc

Pushed to master:

* 49d7b05 file-compressor: Bug #676916 - Use g_open() and g_fopen() instead of libc

Whoever verifies it on Windows please resolve it :)
Comment 7 Massimo 2012-05-30 15:55:35 UTC
Created attachment 215255 [details] [review]
proposed patch

On Windows it does not work, you have to or | _O_BINARY to
the 'flags' parameter passed to 'g_open' as, for example, in

http://git.gnome.org/browse/gimp/tree/plug-ins/common/file-tiff-save.c?h=gimp-2-8#n679

Attaching a patch that I tested on Windows.

If there is no objection, I'll push it.
Comment 8 Massimo 2012-05-31 17:43:26 UTC
Fixed in master and gimp-2-8

commit 321a113212957cb4608fc5e405528963e61e1479
Author: Massimo Valentini <mvalentini@src.gnome.org>
Date:   Thu May 31 19:35:21 2012 +0200

    Bug 676916: Filename garbled when you save .xcf.bz2...
    
    or .xcf.gz files using non-ASCII characters

and

commit bf7fa23bebab3cb794c1422fcdf115363ec9ed49