Professional Web Applications Themes

Escape sequence for unicode characters in NSString - Mac Programming

What is the escape sequence for a unicode character in an NSString? I want to do something like NSString *stuff = "The Greek letter Beta looks like this: \u03b2" But the compiler complains about an 'unknown escape sequence' Thanks for any suggestions, ER...

  1. #1

    Default Escape sequence for unicode characters in NSString


    What is the escape sequence for a unicode character in an NSString?

    I want to do something like

    NSString *stuff = "The Greek letter Beta looks like this: \u03b2"

    But the compiler complains about an 'unknown escape sequence'

    Thanks for any suggestions,

    ER

    Eric Raas Guest

  2. #2

    Default Re: Escape sequence for unicode characters in NSString

    Eric Raas wrote:
    > What is the escape sequence for a unicode character in an NSString?
    >
    > I want to do something like
    >
    > NSString *stuff = "The Greek letter Beta looks like this: \u03b2"
    >
    > But the compiler complains about an 'unknown escape sequence'
    >
    > Thanks for any suggestions,
    >
    > ER
    >
    I don't have the answer to your question, but I can show you what I
    usually do.

    unichar beta=0x03B2;
    NSString* betaString = [NSString stringWithCharacters:&beta length:1];
    NSString* stuff = ["The Greek letter Beta looks like this: "
    stringByAppendingString:betaString];

    -Peter

    Peter Ammon Guest

  3. #3

    Default Re: Escape sequence for unicode characters in NSString

    In article <BB2EFFD2.3D10%foobar.net>, Eric Raas <foobar.net> wrote:
    > NSString *stuff = "The Greek letter Beta looks like this: \u03b2"
    >
    > But the compiler complains about an 'unknown escape sequence'
    Which compiler? The CW plist compiler lets you use \u escape sequences,
    but its c/c++ compiler does not. Dunno about gcc.
    Sean McBride Guest

Similar Threads

  1. \' and \" (general escape characters)
    By Viruss in forum PHP Development
    Replies: 2
    Last Post: May 28th, 10:27 AM
  2. Escape regex harmful characters
    By Kevin Old in forum PERL Beginners
    Replies: 3
    Last Post: December 31st, 03:59 AM
  3. Terminfo: escape sequence for cursor positioning
    By Bernd Huebenett in forum AIX
    Replies: 2
    Last Post: August 28th, 09:20 AM
  4. #7160 [Com]: Bad escape sequence not being reported
    By jerome dot paul at polymtl dot ca in forum PHP Development
    Replies: 0
    Last Post: July 29th, 06:22 PM
  5. Escape Sequence to printer from Web Page
    By h babu in forum ASP.NET General
    Replies: 1
    Last Post: July 16th, 08:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139