How to Get Unicode Value into a String Objective C -


I'm actually trying to get the unicode value of a letter, and put it in a escape string . I set the title of an NSButton to ±, now I am trying to get the title of this button and convert it to "\ U00B1";

For example

  Aichaara the Kart = [The Batton Nightlight at Endx: 0]; // Now how will I change the top of the string like "@ \ \ u03b2"  

There will be a solution:

  unichar theChar = ... NSString * escapeCode = [NSString stringWithFormat: @ "\\\\ u% 04x", author];  

Note that to get two in the string as a result, you need four backslashes.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -