jamel
jamel

Reputation: 313

ucnv_open error U_FILE_ACCESS_ERROR

I just compiled a C++ application on SUN Solaris using CC compiler (CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/2). The application is using an ICU support for the globalization. However when running the application we got the beow error on the method ucnv_open("ibm-9448_X100-2005", &status)

19-Jun 12:12:27 [0]:error opening ICU converter: U_FILE_ACCESS_ERROR


XalanCtrl::XalanCtrl()
  :dLanguage  ( "" ),
   dLegendPage( "" ),
   dLayoutDir ( "" ),
   dBillDocuRoot(""),
   dBillImageRoot("")
{
    dpTransformer = new XalanTransformer();
    myCallback = new CallbackHandler();

  // Create ICU converter
    UErrorCode status=U_ZERO_ERROR;
    const char *erMes;

    ICUcnv = ucnv_open("ibm-9448_X100-2005", &status);
    if(U_FAILURE(status))
     {
      erMes=u_errorName(status );
      tout0 << "error opening ICU converter: " << erMes << endl;
      terr << "FATAL error opening ICU converter: " << erMes << endl;
      throw std::runtime_error( "error opening ICU converter" );
     }
 // Create the ICU buffer used for transcoding
    ICUSize=1024;
    ICUBuffer=new char[ICUSize];
}

The same application is working perfectly but it was compiled on another environment. This is related to the application build?or the compiler? I am expecting some IUC variable or config is not set, but not sure. Do you have any idea on how to solve this kind of issue?

Any help will be appreciated :)

Thanks in advance

Regards,

Upvotes: 4

Views: 4008

Answers (2)

Steven R. Loomis
Steven R. Loomis

Reputation: 4350

You can use ibm-9448_X100-2005 if you really want that exact converter - that is the internal name, most people will just use windows-1256 and get the right alias. That said, do any other converters work? Is it possible your ICU was built without that exact converter?

Upvotes: 0

Sergei Nikulov
Sergei Nikulov

Reputation: 5110

Here the answer

The environment variable ICU_DATA can be set to the full pathname of the data directory to indicate where the locale data files and conversion mapping tables are when you are not using the shared library (e.g. by using the .dat archive or the individual data files). The trailing "/" is required after the directory name (e.g. "$Root/source/data/out/" will work, but the value "$Root/source/data/out" is not acceptable). You do not need to set ICU_DATA if the complete shared data library is in your library path.

Upvotes: 4

Related Questions