Re: [Q] Garbage strings appened to a string
Re: [Q] Garbage strings appened to a string
- Subject: Re: [Q] Garbage strings appened to a string
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 26 Sep 2005 22:35:36 -0600
On Sep 26, 2005, at 10:20 PM, JongAm Park wrote:
Whenever the OK button is pressed, some garbages are appended to
the "Hello, Jane". Sometimes it is OK, though.
Can anyone tell me why this inconsistent result is obtained?
You were probably looking at the UTF-16 BOM, which is 0xFEFF. If you
turn an NSString into Unicode data using any method other than (IIRC)
-getCharacters:, then NSString will always put the UTF-16 BOM in
front of the data.
In any case, if you want to insert a string into another string using
-stringWithFormat:, then use %@ instead of %S as the placeholder.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden