Make fopen() and stat() support UTF-8 paths on Windows

This commit is contained in:
Pete Batard
2012-03-05 17:44:13 +00:00
parent 1f1c20771e
commit 919f39a95d
5 changed files with 74 additions and 10 deletions

View File

@@ -90,3 +90,17 @@ bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst,
bool cdio_charset_to_utf8(char *src, size_t src_len, cdio_utf8_t **dst,
const char * src_charset);
#ifdef _WIN32
/** \brief Convert an UTF8 string to UTF-16 (allocate returned string)
* \param str Source string
* \returns NULL if the conversion was unsuccesful. Caller must free the
* returned string.
* This is a convenience function available on Windows platforms only.
*/
wchar_t* cdio_utf8_to_wchar(const char* str);
/** \brief Provides an UTF-8 compliant version of fopen for Windows
* The parameters and return value are the same as fopen().
*/
FILE* fopen_utf8(const char* filename, const char* mode);
#endif