Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
UTF8 を Unicode 文字列に変換する直接的な NSString 関数が表示されませんか? 変換を行うためにサードパーティのコードを使用する必要がありますか?
何か案は?
とても簡単です。最初に文字列の長さ [str length] を取得し、次に unichar バイトへのポインターを取得します (unichar は多かれ少なかれ UTF-16 です)。
unichar unibuffer[length]; [str getCharacters:unibuffer range:NSRangeMake(0, length]];