Re: Displaying different languages in an NSTableView
Re: Displaying different languages in an NSTableView
- Subject: Re: Displaying different languages in an NSTableView
- From: Ondra Cada <email@hidden>
- Date: Sun, 13 Oct 2002 16:30:01 +0200
On Sunday, October 13, 2002, at 03:50 , Andreas Mayer wrote:
That said, I'm not sure how to do this in cocoa. NSString's initWithData:
encoding: says "data must be an NSData object containing bytes in
encoding". Looks like there is no way to know if the decoding worked. :-/
That's just impossible. Each valid UTF8 string is *also* a valid string in
any 8-bit encoding. Some heuristics like "there is no 0xfe character in
any decent text" help, but are not and can't be completely dependable.
The gist of it, you either have to get the encoding information
"externally" (like, from the format description which says "here's a UTF8"
, or "here's the encoding number", or whatever), or you are in for an ugly
and *incurrably* stochastic code.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.