Winefile: fix "move file" implementation

Francois Gouget fgouget at
Thu Oct 7 04:35:24 CDT 2004

On Thu, 7 Oct 2004, Martin Fuchs wrote:

> Hi Francois,
>>> Winefile was always UNICODE/ANSI-capable by using TCHAR, TEXT(),
>>> and the right functions. Currently ReactOS is using the UNCODE version,
>>> and Wine is using the ANSI version. Both without problems.
>> I think it's wrong that Wine's winefile is ANSI: doesn't that mean we'll
>> have trouble displaying filenames in some cases?
> Some very rare cases - yes may be.
> Does the Wine implementation deliver UNICODE file names anyhow?
> UNICODE filenames are mostly only present when using a NTFS drive.

Of course it does if you call the Unicode functions. Unix systems 
don't store the filenames in Unicode but use codepages. This codepage 
may be UTF-8 which is equivalent to Unicode or some other codepage. 
Wine takes care of converting from that codepage to Unicode.

> Well, changing Wine's winefile to UNICODE is not as easy as in ReactOS:
> - First the problem of TEXT() string constants. They would have to
> converted to the (IMHO) ugly "WCHAR str = {...}" constants.

Ugly but working, both in Wine and in Reactos.

> - Winefile also reads Unix directories using readdir().
> Is there a UNICODE version of this function, or would you have to
> use some UTF-8 conversion?

There's no Unix function that returns 16bit Unicode characters. But the 
filenames retrieved from readdir() can easily be converted to Unicode by 
using MultiByteToWideChar(...CP_UNIX...).

Francois Gouget         fgouget at
                Dieu dit: "M-x Lumi\xE8re". Et la lumi\xE8re fut.

More information about the wine-devel mailing list