aMule Bug Tracker - aMule
View Issue Details
0001621aMuleMiscpublic2010-08-25 16:412010-08-28 22:22
adaptee 
GonoszTopi 
normalmajoralways
resolvedfixed 
SVN 
2.3.1 
10274
Linux
0001621: ed2k links containing unicode characters will cause the filename to be truncated.
1). start amuled or amule

2). add the link below containing Chinese characters

    ed2k "ed2k://|file|??.cue|1953|4171a26ef43c8b44b7dcef10edffc9fc|/" [^]

3). in amule or amulegui, the filename is displayed as "??"?but not the expected "??.cue", i.e, the extension part is lost.

4). the same thing occurs with Japanese characters, such as :

    ed2k://|file|???????srt.rar|197745|689f984f34c72b237b7bffb99d792d60|/ [^]



SVN snapshot: 10273

wxgtk version: 2.8.11

Disto: archlinux

locale: zh_CN.UTF-8

filesystem: reiserfs

compilation parameter:

  ./configure --prefix=/usr \
              --mandir=/usr/share/man \
              --enable-cas \
              --enable-wxcas \
              --enable-amule-daemon \
              --enable-amulecmd \
              --enable-amule-gui \
              --enable-alc \
              --enable-alcc \
              --enable-webserver \
              --disable-debug \
              --enable-optimize \
          --enable-ccache \
          --enable-geoip \
              --enable-nls
No tags attached.
Issue History
2010-08-25 16:41adapteeNew Issue
2010-08-25 16:41adapteeOperating System => Linux
2010-08-25 17:04adapteeNote Added: 0003482
2010-08-27 17:27adapteeNote Added: 0003483
2010-08-27 17:41adapteeNote Edited: 0003483
2010-08-28 22:22GonoszTopiFixed in Revision => 10274
2010-08-28 22:22GonoszTopiNote Added: 0003484
2010-08-28 22:22GonoszTopiAssigned To => GonoszTopi
2010-08-28 22:22GonoszTopiStatusnew => resolved
2010-08-28 22:22GonoszTopiResolutionopen => fixed
2010-08-28 22:22GonoszTopiBuild => 10273
2010-08-28 22:22GonoszTopiFixed in Version => 2.3.1

Notes
(0003482)
adaptee   
2010-08-25 17:04   
Oops, the bug report display all the Chinese and Japanese characters I have inputed as ? , making my report not that useful.

Anybody can show me how to get around this?

Or, just open below pages and try any ed2k links

http://www.verycd.com/topics/2733151/ [^]
http://www.verycd.com/topics/2734762/ [^]
(0003483)
adaptee   
2010-08-27 17:27   
(edited on: 2010-08-27 17:41)
I guess I have found the root cause

// src/libs/common/StringFunctions.cpp

113 wxString UnescapeHTML(const wxString& str)
114 {
115 size_t len = str.length();
116 wxWritableCharBuffer buf = str.char_str(wxConvUTF8);
117
118 // Work around wxWritableCharBuffer's operator[] not being writable
119 char *buffer = (char *)buf;
120
121 size_t j = 0;
122 for (size_t i = 0; i < len; ++i, ++j) {
123 if (buffer[i] == '%' && (len > i + 2)) {
            ......
136 }
        ......
138
147 }

    The 'for' statement iterate by bytes, but variable 'len' is the number of unicode characters, which is often smaller than the number of corresponding utf-8 bytes . That will truncate filenames containing Chinese/Japanese characters.

(0003484)
GonoszTopi   
2010-08-28 22:22   
Fixed. Thanks for the report.