0

I need a representation of µ or "micro". That funny small u with the long tail on the left side. Maybe you can see it here: µ

Some weeks ago I was reading in the docs, that it's a bad idea to type any special characters into the source code. So to prevent problems, could I encode that special character µ somehow like web folks do with  , in an NSString? And if so, is there an overview of these codes or a way to get the correct code?

2 Answers2

1

Take a look at this thread: How do I escape a Unicode character in my Objective-C source code?

NSString *stuff = @"The Greek letter Beta looks like this: \u03b2"
Community
  • 1
  • 1
GoldenBoy
  • 1,381
  • 1
  • 8
  • 11
1

For the iPhone, and for Mac OS X using the Xcode 3.x tool chain (targeting 10.2 or later, which you must be if you're using Xcode 3.x), it is safe and supported to use a literal µ in the string constant. The only caveat is that you must set the -finput-charset command-line option if your source files are not UTF-8 or UTF-16.

Jens Ayton
  • 14,532
  • 3
  • 33
  • 47