首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

中文路径有关问题

2012-04-21 
中文路径问题GDAL库中的一个函数GDALOpen(const char * pszFilename,GDALAccess eAccess);GDALOpen(c:\\t

中文路径问题
GDAL库中的一个函数GDALOpen(const char * pszFilename,GDALAccess eAccess);


GDALOpen("c:\\test.tif",GA_ReadOnly);//可正常执行

但是路径中带有中文就不能正常执行了如下

GDALOpen("c:\\复制test.tif",GA_ReadOnly);//运行时错误


函数参数的解释如下:
Parameters:
pszFilename the name of the file to access. In the case of exotic drivers this may not refer to a physical file, but instead contain information for the driver on how to access a dataset. It should be in UTF8 encoding.
eAccess the desired access, either GA_Update or GA_ReadOnly. Many drivers support only read only access.

请问有什么方法解决吗?

[解决办法]
试试下面函数,是一对:
MultiByteToWideChar
WideCharToMultiByte

热点排行