Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Obj-c

Idiom #24 Assign to string the japanese word ネコ

Declare a new string s and initialize it with the literal value "ネコ" (which means "cat" in japanese)

NSString *s=@"ネコ";

The (most often used) Clang ObjC compiler assumes source files are UTF-8 and interprets them properly.
const char * s = "ネコ";

C has no notion of character sets, output depends on locale settings and terminal capabilities.

New implementation...