gpt4 book ai didi

c++ - ucnv_open 错误 U_FILE_ACCESS_ERROR

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:54:48 25 4
gpt4 key购买 nike

我刚刚使用 CC 编译器(CC:Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/2)在 SUN Solaris 上编译了一个 C++ 应用程序。该应用程序正在使用 ICU 支持全局化。但是,在运行应用程序时,我们在方法 ucnv_open("ibm-9448_X100-2005", &status)

上遇到了 beow 错误
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];
}

同一个应用程序运行良好,但它是在另一个环境中编译的。这与应用程序构建有关?还是与编译器有关?我期待一些 IUC 变量或配置未设置,但不确定。您知道如何解决此类问题吗?

任何帮助将不胜感激:)

提前致谢

问候,

最佳答案

这里是 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.

关于c++ - ucnv_open 错误 U_FILE_ACCESS_ERROR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17187432/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com