bugmldonkey, a multi-networks file-sharing client - Bugs: bug #12608, file name is not incorrect for...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #12608: file name is not incorrect for download

Submitted by:  None
Submitted on:  Fri 08 Apr 2005 05:35:41 PM UTC  
 
Category: CoreSeverity: 3 - Normal
Item Group: i18n issuesStatus: Fixed
Assigned to: NoneOpen/Closed: Closed
Release: Release: 2-5-30-1
Operating System: LinuxBinaries Origin: CVS / Self compiled
CPU type: None

(Jump to the original submission Jump to the original submission)

Wed 13 Apr 2005 05:59:44 PM UTC, comment #7:

Patch by Amorphous is better because some characters are not
allowed on Windows platforms

spiralvoice <spiralvoice>
Project Administrator
Tue 12 Apr 2005 04:27:46 PM UTC, comment #6:

Thank!
I had rewrited by reference mldonkey-2.5.22 in following:
let canonize_basename name =
let name = String.copy name in
for i = 0 to String.length name - 1 do
match name.[i] with
| '/' | '\\' -> name.[i] <- '_'
| _ -> ()
done;
name

The file name is correct after download completed.

That is working in UTF-8 by my server.

Anonymous
Tue 12 Apr 2005 11:05:32 AM UTC, comment #5:

Amorphous made patch #3902 which addresses this problem:

  • Clean up canonize_basename, now that we have charset

conversion. Now we should be able to have most chars in
filenames if the locale is set right.

spiralvoice <spiralvoice>
Project Administrator
Mon 11 Apr 2005 06:11:13 PM UTC, comment #4:

Patch is in patch #3901
The code responsible for the conversion of UTF-8 characters to
"-" can be found in commonInteractive.ml
All characters which have ASCII codes > 127 or < 32 are replaced by "-":

let canonize_basename name =
let buf = Buffer.create 100 in
for i = 0 to String.length name - 1 do
match name.[i] with
| '/' | '\\' -> Buffer.add_char buf '_'
| c ->
(* let remove all chars which are not in the basic ASCII set *)
let nc = int_of_char c in
try
Buffer.add_string buf (List.assoc nc !!filename_conversions)
with _ ->
Buffer.add_char buf (
match c with
(* for Windows *)
':' | '*' | '?' | '"' | '<' | '>' | '|' | '%' -> '_'
| _ ->
if nc > 127 || nc < 32 then '-' else c)
done;
Buffer.contents buf

spiralvoice <spiralvoice>
Project Administrator
Mon 11 Apr 2005 05:55:59 PM UTC, comment #3:

i just changed the charset to UTF-8 as you did and this will be in the next release, however this will not display them correctly. all non ASCII chars are added as a string of numbers to webpages. see savannah bug #9102 for more info.

Amorphous <amorphous>
Mon 11 Apr 2005 09:01:54 AM UTC, comment #2:

Environment in follwing:
Linux xxxx 2.6.11 #3 Mon Mar 28 16:33:45 CST 2005 i686 i686 i386 GNU/Linux
LANG=en_US.UTF-8

modify
mldonkey-2.5.30-4/src/daemon/driver/driverControlers.ml in following:

let http_add_html_header r =
http_add_gen_header r;
add_reply_header r "Pragma" "no-cache";
add_reply_header r "Content-Type" "text/html; charset=UTF-8";
add_gzip_headers r

let http_add_css_header r =
http_add_gen_header r;
add_reply_header r "Content-Type" "text/css; charset=UTF-8";
add_gzip_headers r

let http_add_js_header r =
http_add_gen_header r;
add_reply_header r "Content-Type" "text/javascript; charset=UTF-8";
add_gzip_headers r

Anonymous
Sat 09 Apr 2005 10:57:34 AM UTC, comment #1:

could you send in a patch for the change you made?
is anything wrong after you changed the source?

Amorphous <amorphous>
Fri 08 Apr 2005 05:35:41 PM UTC, original submission:

I had modify srouce code for HTML is UTF-8.
For download finial, that file name is display
------ ------ ae----- --------- 2004 --------- Dreye v6 ---------.txt

That real file name is not correct.

I had run for zh_TW language.

Anonymous

 

Attached Files
file #2850:  Noname1.png added by None (2KiB - image/x-png - The original file name)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Thu 14 Apr 2005 10:21:04 AM UTCspiralvoiceOpen/ClosedOpen=>Closed
Wed 13 Apr 2005 05:59:44 PM UTCspiralvoiceStatusNone=>Fixed
Mon 11 Apr 2005 06:11:13 PM UTCspiralvoiceStatusDuplicate=>None
Mon 11 Apr 2005 05:55:59 PM UTCamorphousStatusNone=>Duplicate
Fri 08 Apr 2005 05:35:41 PM UTCNoneAttached File-=>Added Noname1.png, #2392

Back to the top


Powered by Savane 3.1-cleanup1