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 7984161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:10:50+00:00 2026-06-04T11:10:50+00:00

How to determine string encoding in cocoa? Recently I’m working on a radio player.Sometimes

  • 0

How to determine string encoding in cocoa?
Recently I’m working on a radio player.Sometimes id3 tag text was garbled.

Here is my code:

CFDictionaryRef audioInfoDictionary;
UInt32 size = sizeof(audioInfoDictionary);
result = AudioFileGetProperty(fileID, kAudioFilePropertyInfoDictionary, &size, &audioInfoDictionary);

ID3 info are in audioInfoDictionary. Sometimes the id3 doesn’t use utf8 encoding, and title, artist name were garbled.

Is there any way to determine what encoding a string use?

Special thx!

  • 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-04T11:10:51+00:00Added an answer on June 4, 2026 at 11:10 am

    While it’s an NSString object, there’s no specific encoding since it’s guaranteed to represent whatever is put into it using the encoding determined when it was created. See the Working With Encodings section of the docs.

    From where are you getting the ID3 tags? The time you “receive” this information is the best time to determine its encoding. See Creating and Initializing Strings and the next few sections (for file and url creation) for a list of initializers. Some of them let you set the encoding and others pass back (by reference) the “best guess” encoding the system determined when creating the string. Look for methods with “usedEncoding:” for the system’s reported guess.

    All of this really depends on exactly what is handing you that string. Are you reading it from a file (an MP3) or a web service (Internet Radio)? If the latter, the server’s response should include the encoding and if that’s wrong, there’s not much to do but guess.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Determine a string's encoding in C# Many text editorsr (like Notepad++) can
How can I determine what encoding this string is? Sometimes, it’s the little things
Possible Duplicate: Determine a string's encoding in C# I believe if I create a
Implement an algorithm to determine if a string has all unique characters. What if
In javascript i want to determine if a string is composed only of Hexadecimal
What would be a good way to determine if a string contains an IPv4
How can I determine if an input string only contains spaces, using javascript?
i need to get a string in jQuery to determine an integer value, then
Example: /** * This function will determine whether or not one string starts with
I'm trying to determine the width of a string. I'm using the following code

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.