I wonder which method would be better to convert const char* string to NSString.
I found there are some facts.
- [NSString stringWithCString:length:] is kind of deprecated.
- [NSString stringWithCString:encoding] may be used for my purpose
But I want to convert with length AND encoding(because I want to make that fine if I have some Non-ASCII character by setting encoding to UTF-8). Any thoughts?
I just think now
- create other char and copy with length by using std::strncpy(ch1, ch2, len)
- use [NSString stringWithCString:encoding:]
But it doesn't work well.