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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:07:39+00:00 2026-06-12T18:07:39+00:00

I am porting application from CentOS 6 to Mac OS X. It depends on

  • 0

I am porting application from CentOS 6 to Mac OS X. It depends on iconv and works in CentOS normally. However, on Mac OS X it doesn’t. I see following behavior:

const char *codePages[] = { "MAC", "LATIN1", "ISO_8859-1", "WINDOWS-1252", "ASCII" };
int codePagesCount = 5;
iconv_t converter1 = iconv_open("UTF-32", codePages[0]);// Works
if(converter1 != (iconv_t)-1)
   iconv_close(converter1);
iconv_t converter2 = iconv_open("UTF−32", "MAC");// Fails, returns -1
if(converter2 != (iconv_t)-1)
   iconv_close(converter2);

This piece of code looks trivial: the first iconv_open creates converter and gets code page name from codePages array, its zero element is MAC, so it is logical for me that Mac OS X must support conversion from its own code page to Unicode. And the first call to iconv_open works.
However, the second call to iconv_open does the same. It also creates converter from Mac encoding to Unicode. And for any reason it fails and returns -1.
What may be the reason of such situation when call to the same function with the same arguments (one is element of hardcoded array, another one is hardcoded string) results in normal functionality for the first call and failure for the second one?

  • 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-12T18:07:41+00:00Added an answer on June 12, 2026 at 6:07 pm

    The second “UTF-32” is not the same as the first: the first one uses a plain minus sign whereas the second one uses an endash I guess.

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

Sidebar

Related Questions

I am porting from Centos to Cygwin and find that my application is exiting
I'm in the process of porting an application from Windows to Mac OS X.
We have an application that we're porting to Mac OS from Windows. Once installed,
I am porting an ASP.NET application from 3.5SP1 to 4.0. The application works perfectly
Porting an application from C# (1.1 framework) to VB.NET (3.5 framework), and I have
I am currently porting an application from iOS into Android and I have ran
I'm porting my application from 32 bit to 64 bit. Currently, the code compiles
I am porting an application from iPhone to BlackBerry. BlackBerry apps tend not to
I'm porting my application from Winforms+XNA to WPF (+ XNA?) and I would like
I am porting my application to windows from Linux. I am fairly new to

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.