gnustep-dev
[Top][All Lists]
Advanced

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

Re: Couple of problems with current SVN


From: David Chisnall
Subject: Re: Couple of problems with current SVN
Date: Sat, 2 Jun 2012 10:06:48 +0100

On 2 Jun 2012, at 06:37, Germán A. Arias wrote:

> This is caused
> by the NSString class method -stringWithUTF8String:. If the argument is
> a const char that contains letters like "áéñ", this method return "nil".

If it contains those characters in UTF-8, then that's a bug.  If it's a string 
literal, then you would probably be better off creating it as an Objective-C 
string literal in the first place (since those will always be UTF-8).  As Fred 
and Richard said, you need to be very careful about the encoding of string 
literals, as anything non-ASCII is implementation-defined behaviour.  Clang 
assumes that the source is UTF-8, gcc assumes it's whatever the current locale 
is set to (so if someone Japanese tries compiling code written by someone in 
Korea you get all sorts of interesting things happening).

David

-- Sent from my STANTEC-ZEBRA


reply via email to

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