title: Convert Unicode smiley to nsstring ios
body: <p>I'm working on chat app.I want add support of smiley. I can show smiley direct in iOS using unicode like <code>\ue415</code> for :-). When I send message using this unicode string than other side is receiving square box like <code></code>. How to convert unicode character to nsstring.   </p>
  
  <p>I'm using emotion in collection view like bellow</p>
  
  <p><strong>Code :</strong></p>
  
  <pre><code>data = [NSArray arrayWithObjects:@"\ue415",@"\ue056",@"\ue057",@"\ue414",@"\ue405",@"\ue106",@"\ue418",@"\ue417",@"\ue40d",@"\ue40a",@"\ue404",@"\ue105",@"\ue409",@"\ue40e",@"\ue402",@"\ue108",@"\ue403",@"\ue058",@"\ue407",@"\ue401",@"\ue40f",@"\ue40b",@"\ue406",@"\ue413",@"\ue411",@"\ue412",@"\ue410",@"\ue107",@"\ue059",@"\ue416",@"\ue408",@"\ue40c",@"\ue11a",@"\ue10c",@"\ue32c",@"\ue32a",@"\ue32d",@"\ue328",@"\ue32b",@"\ue022",@"\ue023",nil];
  </code></pre>
  
  <p><strong>CollectionView Delegate Methods</strong></p>
  
  <pre><code>-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
  
      static NSString *CellIdentifier = @"EmojiCell";
  
      UICollectionViewCell *cell =[collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath];
      cell.backgroundColor = [UIColor grayColor];
  
      UILabel *lable = (UILabel *)[cell viewWithTag:100];
  
      lable.text = [data objectAtIndex:indexPath.row];
  
      return cell;
  }
  
  - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
  
      messageField.text = [NSString stringWithFormat:@"%@%@",messageField.text,[data objectAtIndex:indexPath.row]];
  }
  </code></pre>
  
  <p><strong>Code For Sending A Message</strong></p>
  
  <pre><code>NSString *messageStr = self.messageField.text ;
  
      if([messageStr length] &gt; 0) {
  
          NSXMLElement *body = [NSXMLElement elementWithName:@"body"];
          [body setStringValue: messageStr];
  
          XMPPJID *jid = [XMPPJID jidWithString:chatWithUser];
  
          NSXMLElement *message = [NSXMLElement elementWithName:@"message"];
          [message addAttributeWithName:@"type" stringValue:@"chat"];
          [message addAttributeWithName:@"to" stringValue:[jid full]];
          [message addChild:body];
  
          [self.xmppStream sendElement:message];
      }
  </code></pre>