Re: NSString really Unicode?
Re: NSString really Unicode?
- Subject: Re: NSString really Unicode?
- From: Ondra Cada <email@hidden>
- Date: Sat, 13 Mar 2004 13:01:17 +0100
James,
On Saturday, Mar 13, 2004, at 07:56 Europe/Prague, James J. Merkel
wrote:
NSString works with big endian Unicode strings only.
No, that's wrong. NSString imports equally well each endianness; BE is
just a default for improper Unicode strings without a BOM.
If you are reading a file that has little endian strings, you need to
do byte swapping before handing the string to an NSString method.
Presumed you got such a data, you can save effort and source lines by
just prepending the right BOM:
char buffer[SIZE+2]={0xff,0xfe};
fread(buffer+2,sizeof(char),length,fp);
...
---
Ondra Hada
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.