Opened 7 years ago

Closed 7 years ago

#4760 closed Bug (fixed)

transmission-qt breaks unicode characters in the default targed dir

Reported by: ilyak Owned by: jordan
Priority: Normal Milestone: 2.70
Component: Qt Client Version: 2.42
Severity: Normal Keywords: qt unicode
Cc:

Description

Steps to reproduce. On unicode locale, create a directory in home whose name contains non-ascii characters for example, /home/ilyak/Загрузки

start transmission-qt, go to preferences, Downloads tab, point default save location to that dir. Close the dialog. Open the dialog again. The dir name becomes garbled. If repeated more than once, the garbled dir name becomes longer and longer.

I have this screenshot: http://img-fotki.yandex.ru/get/5009/263065.1/0_82119_4ff5dab0_orig

Attachments (2)

download-dir.patch (5.5 KB) - added by rb07 7 years ago.
Fix preferences with foreign characters.
00-download-dir.patch (5.5 KB) - added by rb07 7 years ago.
Same patch for r13447

Download all attachments as: .zip

Change History (14)

comment:1 Changed 7 years ago by Lacrocivious

Confirmed on US English system.

Equivalent screenshot:

https://imgur.com/lp4gb

comment:2 Changed 7 years ago by x190

See also #4759.

"used it with the accentuated folder name, Transmission would heavily slow down and freeze, every time it unfreezes the target folder would be 1 character longer"

comment:3 follow-up: Changed 7 years ago by rb07

The patch was only tested with the download directory, but it should fix similar cases with other directories and file names (i.e. if the finished script is in such a path, or has a name with foreign characters.)

I'm not sure if this affects specific file system types, like ticket #4759 mentioned. My guess is that it affects all uses of Transmission-Qt, but #4759 clearly says that he doesn't see the problem on ext4.

The cause? Qt's QVariant is weird, some times it has a string as UTF-8, other times it has it as a normal QString which has UTF-16 internal representation.

comment:4 in reply to: ↑ 3 Changed 7 years ago by rb07

Replying to rb07:

it should fix similar cases with other directories and file names (i.e. if the finished script is in such a path, or has a name with foreign characters.)

It doesn't, I've just checked with a watch-dir under a directory with foreign characters, and it didn't work (while download-dir is stored as UTF-16, watch-dir seems to be pure ASCII, the foreign characters are skipped).

That means the patch is incomplete.

I also checked a config directory under a path with foreign characters, that worked fine. Of course this is different from the preferences, the later are stored in settings.json, the config dir is not.

comment:5 Changed 7 years ago by rb07

Fixed and improved patch.

This time I tested several preferences (download-dir, watch-dir, and one where I detected a weird side-effect) and its working fine. The previous patch had a big error (missing 'return' statement).

comment:6 Changed 7 years ago by jordan

  • Status changed from new to assigned

comment:7 Changed 7 years ago by jordan

Thanks rb07! :)

comment:8 Changed 7 years ago by rb07

Found another place that is affected: the "Open Torrent" panel, when used with local sessions has "Destination folder:" as second row from the top, the button doesn't show foreign characters right.

Sorry, false alarm. Probably testing with an older version corrupted settings.json, and that was what I saw, the corrupted path.

Last edited 7 years ago by rb07 (previous) (diff)

comment:9 Changed 7 years ago by rb07

Fixed a bug introduced by the old patch.

The bug was a side effect that showed when using the text filter, and could also may be a source of settings corruption.

Changed 7 years ago by rb07

Fix preferences with foreign characters.

comment:10 follow-up: Changed 7 years ago by jordan

rb07, is this patch still up-to-date s.t. I can apply it to trunk for 2.70?

comment:11 in reply to: ↑ 10 Changed 7 years ago by rb07

Replying to jordan:

rb07, is this patch still up-to-date s.t. I can apply it to trunk for 2.70?

Yes, but just to be sure I'm attaching the patch w.r.t. r13447, which to me looks the same.

Changed 7 years ago by rb07

Same patch for r13447

comment:12 Changed 7 years ago by jordan

  • Milestone changed from None Set to 2.70
  • Resolution set to fixed
  • Status changed from assigned to closed

committed in r13448.

Note: See TracTickets for help on using tickets.