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

Submitter:  None
Submitted:  Fri 08 Apr 2005 05:35:41 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  i18n issues Status:  Fixed
Assigned to:  None Open/Closed:  Closed
Release:  2-5-30-1 Release: 
Operating System:  Linux Binaries Origin:  CVS / Self compiled
CPU type:  None

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>
Group 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>
Group 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>
Group 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

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-04-14 spiralvoice Open/ClosedOpen Closed
2005-04-13 spiralvoice StatusNone Fixed
2005-04-11 spiralvoice StatusDuplicate None
2005-04-11 amorphous StatusNone Duplicate
2005-04-08 None Attached File- Added Noname1.png, #2392

Back to the top

Powered by Savane 3.12