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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:26:05+00:00 2026-05-26T16:26:05+00:00

I use ICU4C in a C++ software builded under Windows, Linux and Mac-OSX. I

  • 0

I use ICU4C in a C++ software builded under Windows, Linux and Mac-OSX.
I have an issue ONLY under Mac-OSX, and only related to conversion between UTF16 and WCS (calling u_strToWCS ).
Simply the unicoded chars are replaced with a fixed char.

The ICU4C version doesn’t matter: i try the lastest yesterday.

My Mac OS-X is 10.6.6 (Snow Leopard), GCC: i686-apple-darwin10-gcc-4.2.1.

I also try to switch between shared libraries and static libraries, without any changes.

I reproduce the issue with the code below. Look the variables “c1”, “c2” and “c3”: Windows and Linux give the same result, Mac OS-X not (my issue).

I don’t understand if is a compilation problem, or icu bug, or whatelse.

I hope anyone can suggest to me a direction, or at least confirm my test results.

Thanks.

    // Manually construct UTF16 buffer of this string: http://pastebin.com/HW06TaA9
    unsigned char* pSource = new unsigned char[28];
    pSource[0] = 84;
    pSource[1] = 0;
    pSource[2] = 101;
    pSource[3] = 0;
    pSource[4] = 115;
    pSource[5] = 0;
    pSource[6] = 116;
    pSource[7] = 0;
    pSource[8] = 32;
    pSource[9] = 0;
    pSource[10] = 179;
    pSource[11] = 111;
    pSource[12] = 128;
    pSource[13] = 149;
    pSource[14] = 121;
    pSource[15] = 114;
    pSource[16] = 43;
    pSource[17] = 82;
    pSource[18] = 76;
    pSource[19] = 136;
    pSource[20] = 63;
    pSource[21] = 101;
    pSource[22] = 64;
    pSource[23] = 83;
    pSource[24] = 125;
    pSource[25] = 0;
    pSource[26] = 0;
    pSource[27] = 0;

    int32_t nChars = 100;
    wchar_t* pDest = new wchar_t[nChars];
    memset(pDest, 0, nChars * sizeof(wchar_t));

    UErrorCode status = U_ZERO_ERROR;
    u_strToWCS(pDest, nChars, &nChars, (const UChar*) pSource, -1, &status);
    if(U_SUCCESS(status))
    {
        wchar_t c1 = pDest[2];  // Ascii char. Win: 115, Linux: 115, OS-X: 115 
        wchar_t c2 = pDest[5];  // Japan char. Win: 28595, Linux: 28595, OS-X: 26
        wchar_t c3 = pDest[6];   // Japan char. Win: 38272, Linux: 38272, OS-X: 26
    }
  • 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-26T16:26:06+00:00Added an answer on May 26, 2026 at 4:26 pm

    See this bug. This had been already fixed in latest ICU and I’ve included a workaround. https://ssl.icu-project.org/trac/ticket/8894#comment:4

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

Sidebar

Related Questions

use LWP::Simple; use Parallel::ForkManager; @links=( [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-windows.exe,SweetHome3D-2.1-windows.exe], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-macosx.dmg,SweetHome3D-2.1-macosx.dmg], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3DViewer-2.1.zip,SweetHome3DViewer-2.1.zip], ); # Max 30 processes for
Use case: Fitnesse is used for automated testing of the web site. SUT (software
Use Elixir and have two entities -- Voter and Candidate -- with many to
use javascript or other method ? have any recommendation?
Use case: You have 2-3 files displayed in your MacVim window(s). You press ctrl+Q
use case example I have a servlet that is receiving login requests. If a
I have a JNI function that returns a UChar array (from the ICU4C library)
Use a hidden field will fix my issue... i got it.. Hi All, I
I am going to use ICU4C unicode library with version 4.2.1 (the version which
Use case: we have some project meta-data files which we want tracked, but are

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.