[Top][All Lists]

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

Re: Patch for unicode support on Win32 in GNUstep base

From: Richard Frith-Macdonald
Subject: Re: Patch for unicode support on Win32 in GNUstep base
Date: Wed, 25 Aug 2004 09:54:06 +0100

On 25 Aug 2004, at 09:41, Richard Frith-Macdonald wrote:

On 24 Aug 2004, at 04:41, Adam Fedor wrote:

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?

My feeling is that, if the filesystem names are going to be unicode (ie contain characters which can't be represented in any one single byte characterset), the encoding should be utf-8 and so -fileSystemRepresentation would return a utf-8 sequence, which could then be converted to 16-bit unicode if/when it is passed to a system call.

The only problem with that is ... what if people set their default encoding to be (for instance) latin1, but they try to use filenames containing characters which can't be represented in that characterset and need utf-8? I think this could be a problem on any system though, not just windows.

PS. The base library contains (Source/Additions/Unicode.m) GetDefEncoding(), GSToUnicode() and GSFromUnicode()
functions which should make any conversions pretty simple and efficient.

reply via email to

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