MCPcopy Create free account
hub / github.com/OSGeo/gdal / CPLfopenUTF8

Function CPLfopenUTF8

port/cpl_error.cpp:997–1012  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

995static bool bLogInit = false;
996
997static FILE *CPLfopenUTF8(const char *pszFilename, const char *pszAccess)
998{
999 FILE *f;
1000#ifdef _WIN32
1001 wchar_t *pwszFilename =
1002 CPLRecodeToWChar(pszFilename, CPL_ENC_UTF8, CPL_ENC_UCS2);
1003 wchar_t *pwszAccess =
1004 CPLRecodeToWChar(pszAccess, CPL_ENC_UTF8, CPL_ENC_UCS2);
1005 f = _wfopen(pwszFilename, pwszAccess);
1006 VSIFree(pwszFilename);
1007 VSIFree(pwszAccess);
1008#else
1009 f = fopen(pszFilename, pszAccess);
1010#endif
1011 return f;
1012}
1013
1014/** Default error handler. */
1015void CPL_STDCALL CPLDefaultErrorHandler(CPLErr eErrClass, CPLErrorNum nError,

Calls 3

CPLRecodeToWCharFunction · 0.85
VSIFreeFunction · 0.85
fopenFunction · 0.85

Tested by

no test coverage detected