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

  • Home
  • SEARCH
  • 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 824497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:06:32+00:00 2026-05-15T03:06:32+00:00

In the apple document, I can see that there’s a way to convert from

  • 0

In the apple document, I can see that there’s a way to convert from UTF8 string to ASCII string like this

NSData *asciiData = [theString dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *asciiString = [[NSString alloc] initWithData:asciiData encoding:NSASCIIStringEncoding];

But my app requires a TIS-620 string to post to a site so I try to do the same thing

NSData *asciiData = [newPost.header dataUsingEncoding:kCFStringEncodingMacThai allowLossyConversion:YES];
NSString *asciiString = [[NSString alloc] initWithData:asciiData encoding:kCFStringEncodingMacThai];
NSLog(@"%@", asciiString);

The output I got is like this ???????????.

Does anyone know how to convert the NSString to TIS-620 properly?
Thanks so much.

  • 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-05-15T03:06:33+00:00Added an answer on May 15, 2026 at 3:06 am

    Firstly, TIS-620 is a subset of ISO-8859-11, so you should use the string encoding kCFStringEncodingISOLatinThai instead of kCFStringEncodingMacThai.

    Also, a CF encoding cannot be directly used to decode an NSString. You need to convert the CF encoding into NS encoding first.

    NSStringEncoding = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingISOLatinThai);
    NSData *asciiData = [newPost.header dataUsingEncoding:enc allowLossyConversion:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the official Apple document it says alert string or dictionary If this property
Apple developer document has the QTKit examples. I have noticed that it is only
As Apple's document says, dispatch_get_global_queue() is a concurrent queue, and dispatch_sync is something meaning
I have about 100 stylesheets that apply the same style to one document, exactly
Apple have long blocked mobile Safari from playing sounds – the usual JavaScript commands
Apple wants me to give the user a friendly apology if I can't find
New on HTML5 there's an invalid event, to which you can add a listener:
I have been trying to scrape the 'School Notices' from this URL http://www.isleworthsyon.hounslow.sch.uk/ I
I have a simple HTML template that's used multiple times across the document. It's
I am trying to understand the concept of document storage and fail to see

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.