• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSString really Unicode?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString really Unicode?


  • Subject: Re: NSString really Unicode?
  • From: Ondra Cada <email@hidden>
  • Date: Fri, 12 Mar 2004 16:53:15 +0100

On Friday, Mar 12, 2004, at 16:38 Europe/Prague, Allan Odgaard wrote:

So after reading the data, but before creating the string, try to insert this code:

uint16_t* tmp = (uint16_t*)valueBuf;
for(size_t i = 0; i < valueLength/2; i++)
CFSwapInt16(*tmp++);

And then use NSUnicodeStringEncoding as the encoding.

Wouln't it be much better just to prepend the mark word 0xfeff in the proper endianness? (After all, it *should* be part of the original Unicode ;))
---
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.


  • Follow-Ups:
    • Re: NSString really Unicode?
      • From: "James J. Merkel" <email@hidden>
References: 
 >Re: NSString really Unicode? (From: Allan Odgaard <email@hidden>)

  • Prev by Date: Re: NSString really Unicode?
  • Next by Date: Re: NSString really Unicode?
  • Previous by thread: Re: NSString really Unicode?
  • Next by thread: Re: NSString really Unicode?
  • Index(es):
    • Date
    • Thread