Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7714691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:11:42+00:00 2026-06-01T02:11:42+00:00

How to convert hexadecimal value into emoji icons , I have a string like

  • 0

How to convert hexadecimal value into emoji icons , I have a string like below

NSString *myVal = @"1F61E";

how can i convert this text to display it as emoji charrcaters?

I have found that value from this link
Please let me know, i am really stuck-up with this issue

Updated

NSString *utf8String1 = @"1F61E";
NSString *a = [self convert:utf8String1];
NSLog(@"%@ &&&&&&&&&&&&&&&&&&&&&",a);


-(NSString*)convert:(NSString*)decoded{

    unichar unicodeValue = (unichar) strtol([decoded UTF8String], NULL, 16);
    char buffer[2];
    int len = 1;

    if (unicodeValue > 127) {
        buffer[0] = (unicodeValue >> 8) & (1 << 8) - 1;
        buffer[1] = unicodeValue & (1 << 8) - 1; 
        len = 2;
    } else {
        buffer[0] = unicodeValue;
    }

    return [[NSString alloc] initWithBytes:buffer length:len encoding:NSUTF8StringEncoding];



}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:11:43+00:00Added an answer on June 1, 2026 at 2:11 am

    The code point that you are trying to encode does not fit in 16 bits. Therefore you need to use UTF-32 encoding:

    NSScanner *scan = [[NSScanner alloc] initWithString:@"1F61E"];
    unsigned int val;
    [scan scanHexInt:&val];
    char cc[4];
    cc[3] = (val >> 0) & 0xFF;
    cc[2] = (val >> 8) & 0xFF;
    cc[1] = (val >> 16) & 0xFF;
    cc[0] = (val >> 24) & 0xFF;
    NSString *s = [[NSString alloc]
        initWithBytes:cc
               length:4
             encoding:NSUTF32StringEncoding];
    NSLog(@"[%@]", s);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to convert integer value into hexadecimal. I have done with some logical,
I have a string which contains a hexadecimal value: 29E94B25 I want to convert
How can you convert a byte array to a hexadecimal string and vice versa?
How can I convert ASCII values to hexadecimal and binary values (not their string
I'm trying to convert this string 0x00009F0900000000 into a date either through MySql or
I have a hexadecimal value, 07A5953EE7592CE8871EE287F9C0A5FBC2BB43695589D95E76A4A9D37019C8 Which I want to convert to a byte
I found the code to convert a hexadecimal string into a signed int using
I want to convert from char representing a hexadecimal value (in upper or lower
How to convert hexadecimal string to single precision floating point in Java? For example,
I have a stored procedure that needs to convert hexadecimal numbers to their decimal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.