MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / hb_fopen

Function hb_fopen

libhb/ports.c:830–847  ·  view source on GitHub ↗

* hb_fopen ************************************************************************ * Wrapper to the real fopen, needed to handle utf8 filenames on * windows. ***********************************************************************/

Source from the content-addressed store, hash-verified

828 * windows.
829 ***********************************************************************/
830FILE * hb_fopen(const char *path, const char *mode)
831{
832#ifdef SYS_MINGW
833 FILE *f;
834 wchar_t path_utf16[MAX_PATH];
835 wchar_t mode_utf16[16];
836 if (!MultiByteToWideChar(CP_UTF8, 0, path, -1, path_utf16, MAX_PATH))
837 return NULL;
838 if (!MultiByteToWideChar(CP_UTF8, 0, mode, -1, mode_utf16, 16))
839 return NULL;
840 errno_t ret = _wfopen_s(&f, path_utf16, mode_utf16);
841 if (ret)
842 return NULL;
843 return f;
844#else
845 return fopen(path, mode);
846#endif
847}
848
849HB_DIR* hb_opendir(const char *path)
850{

Callers 8

hb_save_previewFunction · 0.85
hb_read_previewFunction · 0.85
decsrtInitFunction · 0.85
hb_value_read_jsonFunction · 0.85
enctheoraInitFunction · 0.85
hb_stream_openFunction · 0.85
encavcodecInitFunction · 0.85
hb_open_csv_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected