gnustep-dev
[Top][All Lists]
Advanced

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

Re: NSProcessInfo.m: Unicode compliance of _gnu_process_args()


From: Richard Frith-Macdonald
Subject: Re: NSProcessInfo.m: Unicode compliance of _gnu_process_args()
Date: Wed, 26 Apr 2006 14:52:12 +0100


On 26 Apr 2006, at 13:57, Roland Schwingel wrote:


Hi...

A few minutes ago I was reading (after a long time) thru current gnustep-base code... In NSProcessInfo.m:_gnu_process_args() I assume some unicode problems, which would be easy to fix...

The arguments and/or the env supplied to this function can be encoded in utf-8.

Sure they can.

So the initWithCString:/stringWithCString: calls in this functions should be replaced by initWithUTF8:/stringWithUTF8 calls. Elsewise I think this will cause problems if you run apps located in unicode folders or when using environmentvariables/arguments
containing utf-8 characters...

I think not ...

The argument/environment strings are, (by definition since they are coming from outside the program), in the external character encoding. The initWithCString: method initialises a string with data in the external character encoding. The current code should therefore be correct whatever the external encoding is.

If you changed the code to use initWithUTF8String: it would be wrong on any system where UTF8 is not used as the external character coding.

NB. NSString determines the external character encoding from standard environment variables, and those variable names and values are by definition ASCII, and are accessed via plain C functions and should therefore work irrespective of the external character encoding in use.





reply via email to

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