Author Topic: Faild to upload file with hebrew filename  (Read 1675 times)

0 Members and 1 Guest are viewing this topic.

Zrubi

  • Guest
Faild to upload file with hebrew filename
« on: February 24, 2008, 08:59:34 PM »
Hey, I am new with HFS but I like it very much, however I tried to use it to upload file
but when I am trying to upload files with Hebrew filenames it said that it successfully uploaded but the file wasn't really uploaded

Offline TSG

  • Operator
  • Tireless poster
  • *****
  • Posts: 1934
    • View Profile
    • RAWR-Designs
Re: Faild to upload file with hebrew filename
« Reply #1 on: February 25, 2008, 11:13:24 AM »
This occurs with Asian characters aswell. HFS doesn't fully support Unicode yet, rejetto will explain it more when he comes online.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Faild to upload file with hebrew filename
« Reply #2 on: February 25, 2008, 10:54:08 PM »
what version are you using?

Offline champignac

  • Occasional poster
  • *
  • Posts: 1
    • View Profile
Re: Faild to upload file with hebrew filename
« Reply #3 on: March 11, 2008, 03:00:40 AM »
hi :)

Same problem with french char likes é è à ê ü.

I'm using HFS v2.2d Build 152.
XP SP2 French
NTFS Files system.

When someone upload a file, it's seems Ok. Like this.

Quote
23:18:19 florian@*.*.*.*:1769 Uploading SoftICE Command Référence.rar
23:19:06 florian@*.*.*.*:1769 Fully uploaded -  575.54 KB @ 12 KB/s

But the file isn't created on my Hard-disk. Same thing occur in local transfert. I suppose is the same problem with all other specials char languages (like chinese).

The same file without french char (SoftICE Command Reference.rar), the upload works fine. File is created and uploaded on my Hard-disk.

Thanks for all :)
Posted on: March 10, 2008, 05:44:08 PM
Bug found :)

Into this function:
Code: [Select]
 function getUploadDestinationFileName():string;
  var
    i: integer;
    fn, ext: string;
  begin
  fn:=optAnsi(tpl.utf8, conn.post.filename);
  if tpl.utf8 then fn:=UTF8toAnsi(fn); <<- bug here
  result:=f.resource+'\'+fn;
  if not numberFilesOnUploadChk.checked then exit;
  ext:=extractFileExt(fn);
  setLength(fn, length(fn)-length(ext));
  i:=0;
  while fileExists(result) do
    begin
    inc(i);
    result:=format('%s\%s(%d)%s', [f.resource,fn,i,ext]);
    end;
  end; // getUploadDestinationFileName

In asm:
Code: [Select]
0051BAB5   .  A1 6C9A5400   MOV EAX, DWORD PTR [549A6C]
0051BABA   .  8078 28 00    CMP BYTE PTR [EAX+28], 0
0051BABE   .  75 0B         JE SHORT 0051BACB                       ;  << JE patched to JMP
0051BAC0   .  8D55 FC       LEA EDX, DWORD PTR [EBP-4]
0051BAC3   .  8B45 FC       MOV EAX, DWORD PTR [EBP-4]
0051BAC6   .  E8 D5B8EEFF   CALL 004073A0                            ;  004073A0
0051BACB   >  8B45 08       MOV EAX, DWORD PTR [EBP+8]

When I'm forcing this conditionnal jump, file is succefully saved into my upload directory with the corrects chars.

I let you decide but it's works for me :)