Localized characters are removed from filename while starting download

Bug #480898 reported by Rumata
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LinuxDC++
Invalid
Undecided
Unassigned

Bug Description

When I start downloading some file with localized characters in the name (for examle "Имя файла - file name.txt"), the incomplete filename appears in incomplete folder but all localized characters are removed (in that case " - file name.txt.4G3JT4ZPPSIJ64TII7ZOZRRCFHC7PMCYX6GIOGA.dctmp" with 2 spaces in the beginning!). After downloading is complete, it is moved with name still without localized characters (" - file name.txt").

Hub encoding: cp1251.
Localized characters in my case are cyrrilic.

Ubuntu: 9.10
LinuxDC++ version: 1.0.3
Core version: 0.698

Tags: charset
Revision history for this message
Steven Sheehy (steven-sheehy) wrote :

Where are you initiating the download from (search, sharebrowser)? Does the filename show up properly in the GUI while searching/browsing share/downloading? If it's in a file list can you extract and open the file list and ensure the filename is in the encoding that the xml states in its header (use iconv)? If encoding is missing the parser defaults to utf-8. It's possible that the file list says it's utf-8 but is actually in CP1251 or KOI8-R in which case the character conversion will fail for non-ASCII characters.

Changed in linuxdcpp:
status: New → Incomplete
tags: added: charset
Revision history for this message
Rumata (rumata-estor) wrote :

There is real filelist in the attachment. As I can see it is encoded in utf-8. I tried to download the file
<File Name="031 А-СТУДИО - ДЖУЛИЯ.mp3" Size="9250130" TTH="4MFUSQOPZVSW4ZIINSNKBNZOIJLO3AVKHVTJH3Q"/>
and resulting file name became "031 - - .mp3"
In UI everything looks ok. But it's not on a filesystem.

Revision history for this message
Steven Sheehy (steven-sheehy) wrote :

As you say, the filename shows correctly in the UI and the filelist is correctly encoded. I added a file with that name to my share and downloaded it from myself (using another instance). The file was created in my filesystem fine with the correct name. This isn't quite a proper test, but it's the best I could due to try to reproduce unless you want to provide me the hub you are using so I can try from the actual user. Can you also provide me the output of `locale`?

Revision history for this message
Rumata (rumata-estor) wrote :

~$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

I'm not sure that hub can be accessed from internet. However address: dc.netorn.ru, encoding: CP1251 (Cyrillic)

Revision history for this message
Steven Sheehy (steven-sheehy) wrote :

Yeah, it's not a public hub. That's the exact same locale output I have. I'm a bit out of ideas, unless you want to compile the latest trunk and I can provide some patches for additional logging so we can narrow it down...

Revision history for this message
Rumata (rumata-estor) wrote :

I'm very sorry but it seems to be my fault!

Launching just compiled version from build folder worked fine. And launching after installation with gnome menu worked with the same error.
So I've found "env LC_CTYPE=ru_RU.CP1251 linuxdcpp" in launcher command. I've never tryed to launch with this options from command line and now I see:
Gtk-WARNING **: Locale not supported by C library.
 Using the fallback 'C' locale.

Very sorry for 2 unexisting bugs.

Revision history for this message
Steven Sheehy (steven-sheehy) wrote :

Ok, glad it's working now.

Changed in linuxdcpp:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.