How do I escape a Unicode character in my Objective-C source code?

前端 未结 5 1696
北恋
北恋 2020-12-06 04:00

I feel incredibly stupid for asking this, but the documentation and Google are giving me no love at all.

I have a Unicode character I want to insert into a string li

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-06 04:40

    The proper escape sequence would be something along the lines of

    wchar_t * str = L"\x0627";
    

    See this question: character constant:\000 \xhh

    Edit: Oh, sorry, I missed the iPhone and Objective-C tags. The above is valid for generic C/C++, but I have not worked with iPhone development so your mileage may vary.

提交回复
热议问题