bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch #4598] filesystemRepresentation on Win32 is DANGEROUS as impl


From: Sheldon Gill
Subject: Re: [patch #4598] filesystemRepresentation on Win32 is DANGEROUS as implemented
Date: Sat, 05 Nov 2005 09:28:23 +0800
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Jeremy Bettis wrote:
URL:
  <http://savannah.gnu.org/patch/?func=detailitem&item_id=4598>

                 Summary: filesystemRepresentation on Win32 is DANGEROUS as
implemented
                 Project: GNUstep
            Submitted by: jeremybettis
            Submitted on: Fri 11/04/05 at 21:01
                Category: Foundation
                Priority: 9 - Immediate
                  Status: None
                 Privacy: Public
             Assigned to: None
Originator Email: Open/Closed: Open

    _______________________________________________________

Details:

*) filesystemRepresentation is declared as returning char* when it actually
returns unichar*
*) Even gnustep-base itself has uses of filesystemRepresentation that are not
expecting unichars.
*) Unicode is NOT the native filesystem encoding for the Win32 API.  Win32
actually has 2 "native" encodings.

This patch resolves all of these issues.
new method -unicodeFilesystemRepresentation
fixed all win32 uses of filesystemRepresentation to use the new
unicodeFilesystemRepresentation
fixed all of the occurances of a unicode string being passed to a ANSI api
call

I agree that fileSystemRepresentation as it currently is in HEAD is dangerous. However, I think this is the wrong solution.

fileSystemRepresentation should return char* so it can be passed on to *nix/C routines. That is what it was designed for.

We don't need to use it for unicode. It's symptomatic of the the current situation where Win32 unicode work is incomplete. We should fix the problems where they really lie rather than try to mask them with an additional method.

The difficulty here has arisen because of the path munging on Win32 which is really unnecessary and causes more problems than it's worth. We shouldn't need fileSystemRepresentation to convert from an internal format.



Regards,
Sheldon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]