views:

20

answers:

1

i used + (id)stringWithCString:mycharaters encoding:NSUnicodeStringEncoding

mycharaters is a char array with an intermediate null charaters and end with two null charaters.

char mycharaters[20];

it contains a unicode string and i want to show it.

but "The array must end with a NULL character; intermediate NULL characters are not allowed."

I wonder how could I show it.

PS:this string contains Chinese and numbers or letters.

A: 

Split the string at the single NULL characters, then convert them and put them together again.

I'd say using single and double NULL is quite unusual...

Eiko
The datatype is not too uncommon: it's a string of strings. Technically it's terminated by an empty string. COnsider the pair of `'\0'` s at the end. The first `\0` terminates the last non-empty string, and the second terminates the empty string.
MSalters