Re: NSAttributedString error....
Re: NSAttributedString error....
- Subject: Re: NSAttributedString error....
- From: Aki Inoue <email@hidden>
- Date: Thu, 30 Jan 2003 11:46:42 -0800
Steven,
It seems your NSString, myTextfield, contains Cyrillic characters and
you're running in one of West European langs, possibly English. If you
want your app to have the multilingual capability like this, the usage
of -cString method doesn't work.
Since you're creating an NSAttributedString out of an HTML data, you
need to be aware of string encoding details.
If your intention is just to create attributed strings out of HTML, you
can use -UTF8String method and specify NSUTF8StringEncoding in
documentAttributes.
Aki
On 2003.1.30, at 08:03 AM, Steven M.Palm wrote:
When trying to us an NSAttributedString as follows:
attribText = [[NSAttributedString alloc] initWithHTML:[NSData
dataWithBytes:[myTextfield cString] length:[myTextField
cStringLength]] documentAttributes:NULL];
if (nil != attribText) {
sockprintf("%s\r\n\r\n", [[attribText string] cString]);
} else {
sockprintf("Plain text not available.\r\n\r\n");
}
I get the error in the Run Window of Project Builder:
Conversion to encoding 30 failed for string "30
\\u044f\\u043d\\u0432\\u0430\\u0440\\u044f 2003\\u0433. \\u2116 1..."
And my Application just sits there unresponsive until I kill it.
Neither case of the /if/ test is executed.
-----------------------
- Steven M. Palm
- Ham Radio Call: N9YTY
-----------------------
_______________________________________________
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.
_______________________________________________
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.