Jargen89
Jargen89

Reputation: 480

Building unicode string from existing NSString

I have an NSString like this @"uE604" that I want to add a backslash too in order to use it as a unicode character. However I am having issues trying to get that to work. If I add @"\\" to the front of it, it doesn't work.

Any way I can get it working?

Upvotes: 1

Views: 78

Answers (2)

Caio
Caio

Reputation: 370

Just use one slash, since you are working with Unicode you don't need to escape the slash:

NSString *s = @"\u266A";

Upvotes: 0

par
par

Reputation: 17734

Try using just one slash: @"\uE604".

Upvotes: 1

Related Questions