This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[3.2dev] KTorrent cut long filenames in wrong place.

Tags: None
(comma "," separated)
Lain_13
Registered Member
Posts
103
Karma
0
Filename in list (text on russian):
Code: Select all
04. А я не верил...(новая версия) (С.Козлов,А.Алпаев-А.Дроздов).mp3

I can create file with this name on HDD without any problems.
File, created on HDD by kTorrent:
Code: Select all
04. А я не верил...(новая версия) (С.Козлов,А.Алпаев-... .mp3

KTorrent shouldn't cut filenames like here. Maybe source of bug -- non-English letters in filename and wrong calculation of string length.


What isn`t remembered never happened. Memory is merely a record. You just need to rewrite that record.
George
Moderator
Posts
5421
Karma
1

Tue Jan 06, 2009 1:37 pm
Send me that torrent
Lain_13
Registered Member
Posts
103
Karma
0

Tue Jan 06, 2009 3:26 pm
I sent you e-mail.


What isn`t remembered never happened. Memory is merely a record. You just need to rewrite that record.
Lain_13
Registered Member
Posts
103
Karma
0

Wed Jan 07, 2009 1:46 pm
George, did you reproduce bug with torrents which I sent you?


What isn`t remembered never happened. Memory is merely a record. You just need to rewrite that record.
George
Moderator
Posts
5421
Karma
1

Wed Jan 07, 2009 6:19 pm
I'm working on it, if I remove the shortening code, the third torrent still works, so there is something wrong with the length calculation. We use the encoded name to determine the length, but this does not seem to be correct.
George
Moderator
Posts
5421
Karma
1

Wed Jan 07, 2009 7:43 pm
It seems that encoding the filename for some reason overestimates the length of the file.
Lain_13
Registered Member
Posts
103
Karma
0

Thu Jan 08, 2009 12:35 am
When you encode Russian and any other non-English characters each character in result string represented by more then one symbol. For example, it's web-address with Russian word "Тест" (test) in the end: http://ru.wikipedia.org/wiki/%D0%A2%D0%B5%D1%81%D1%82
As you can see each character represented as... 6 characters! Every character in Russian word test represented by 2 bytes which written as 4 characters and 2 separators.

If I understand right filename limited to 255 symbols and when kTorrent count amount of characters in string he count... bytes in encoded string! But when almost all symbols non-English this method fails, because each non-English symbol represented as 6 bytes!


What isn`t remembered never happened. Memory is merely a record. You just need to rewrite that record.
George
Moderator
Posts
5421
Karma
1

Thu Jan 08, 2009 9:51 am
Lain_13 wrote:If I understand right filename limited to 255 symbols and when kTorrent count amount of characters in string he count... bytes in encoded string! But when almost all symbols non-English this method fails, because each non-English symbol represented as 6 bytes!


It is more complicated then that, the limit is actually 4096, however each component of a path can only be 255 bytes in length.
George
Moderator
Posts
5421
Karma
1

Thu Jan 08, 2009 9:52 am
Anyway, this is fixed now


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]