Re: Foolish question about NSStrings
Re: Foolish question about NSStrings
- Subject: Re: Foolish question about NSStrings
- From: Chris Ridd <email@hidden>
- Date: Thu, 28 Nov 2002 10:09:25 +0000
On 28/11/02 9:48 am, Marco Binder <email@hidden> wrote:
>
Have you tried the first sugestion "use another accepted method and
>
declare it static if you want"? There is a class method
>
>
+ (id)stringWithUTF8String:(const char *)bytes
>
>
in NSString, which should do what you want.
I haven't *actually* tried that, but it certainly looks as though it would
work.
A minor snag with it is that I'd have to convert all my strings into UTF-8
sequences, which is a bit awkward and makes it hard to easily edit the
values in the source code. (No doubt I'd write a little tool to do this and
just paste the results in to the source code).
Since my strings are all quite short and I'm going to be using them to
construct longer strings (I'm converting values from some character
encodings not supported by Apple), I'll probably use arrays of unichars and
munge them into strings (+initWithCharacters:length:) when required.
>
marco
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.