• 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: C++ string and UTF8
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ string and UTF8


  • Subject: Re: C++ string and UTF8
  • From: Alexander Dymerets <email@hidden>
  • Date: Thu, 07 Apr 2005 16:56:25 +0300
  • Organization: The Product Engine (Odessa)

Julien Palmas wrote:

And what if the c++ string contains Unicode (UTF-16), and not UTF-8 ?
This time it looks like I can't use c_str() ...

std::string can't contain UTF-16 characters. You can do something like this:

typedef std::basic_string<unichar> unistring;
unistring ustr;
//..........
NSString *cocoa_str = [NSString stringWithCharacters: ustr.c_str() length: ustr.length()];
_______________________________________________
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
References: 
 >C++ string and UTF8 (From: Julien Palmas <email@hidden>)
 >Re: C++ string and UTF8 (From: daniel <email@hidden>)
 >Re: C++ string and UTF8 (From: Julien Palmas <email@hidden>)
 >Re: C++ string and UTF8 (From: Julien Palmas <email@hidden>)

  • Prev by Date: *Help* with mysterious crash... CFRetain related
  • Next by Date: Scroll view contents resize flags
  • Previous by thread: Re: C++ string and UTF8
  • Next by thread: Re: C++ string and UTF8
  • Index(es):
    • Date
    • Thread