Character encoding of C-string runtime functions?

  • A function like sel_getName() returns a const char* NULL-terminated C string. What is the character encoding of this string?

    --
    Rick
  • On Jun 11, 2013, at 2:21 PM, Rick Mann <rmann...> wrote:
    > A function like sel_getName() returns a const char* NULL-terminated C string. What is the character encoding of this string?

    Formally unspecified. It's possible to create a selector or class at runtime with arbitrary zero-terminated bytes and the runtime won't care.

    In practice you should use UTF-8. That's what the compiler does.

    --
    Greg Parker    <gparker...>    Runtime Wrangler
  • On Jun 11, 2013, at 14:32 , Greg Parker <gparker...> wrote:

    > Formally unspecified. It's possible to create a selector or class at runtime with arbitrary zero-terminated bytes and the runtime won't care.
    >
    > In practice you should use UTF-8. That's what the compiler does.

    Thanks. That's what I've always done, but I wondered, since by default Xcode used to make files UTF-16. At least, it did the strings file. Now it seems my files are all UTF-8, so I would imagine that would (should) drive the encoding.

    --
    Rick
previous month june 2013 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today