Number of chars
Number of chars
- Subject: Number of chars
- From: Luca Ciciriello <email@hidden>
- Date: Thu, 21 Mar 2013 09:27:44 +0100
Hi all.
I'm using in my iOS project some Objective-C++ modules. Here I have some conversion from NSString to C++11 std::string. After this conversion I found (correctly) in my std::string some 2-byte characters.
My question is: How can I count the number of chars and not the numbers of byte in my std::string?
Example.
if my std::string test contains 2 1-byte chars and 1 2-byte (UNICODE) char, I have:
num of char of "test" = 3
num of byte (test.size()) of "test" = 4
Luca.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden