gnustep-dev
[Top][All Lists]
Advanced

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

Re: Patch for unicode support on Win32 in GNUstep base


From: Adam Fedor
Subject: Re: Patch for unicode support on Win32 in GNUstep base
Date: Mon, 23 Aug 2004 21:41:46 -0600


On Aug 4, 2004, at 5:14 AM, Roland Schwingel wrote:
Well... The reason for adding the additional 'w' method for
fileSystemRepresentationWithPath: is that fileSystemRepresentationWithPath:
is defined to return const char* in the OpenStep spec. If your path contains
unicode chars you cannot convert them to const char*. You need to convert
them to const unichar* to be later on able to work with it.

Having just one method (fileSystemRepresentationWithPath:)would mean to
change it to return either const unichar* instead of const char* or
NSString. Both would break the OpenStep spec and compatibililty.

So we introduced (yet only internally used in GNUstep base and only for
windows)
wFileSystemRepresentation: to be able to handle paths containing unicode
characters
on windows.


I can see the logic of adding another method. Although it may be possible to cast back and forth from (unichar *) to (char *), it isn't good programming practice, and not very intuitive either (how does a developer know which format -fileSystemRepresentation is in, except perhaps for the documentation and checking which OS you are on).

Still, you state that it is only used internally in base (perhaps it should be in a private header?) but should we restrict developers from using themselves if they want?

Any other opinions?
reply via email to

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