WindowsUtils.localeFilenameFromUtf8

Converts a filename from UTF-8 to the system codepage. On NT-based Windows, on NTFS file systems, file names are in Unicode. It is quite possible that Unicode file names contain characters not representable in the system codepage. (For instance, Greek or Cyrillic characters on Western European or US Windows installations, or various less common CJK characters on CJK Windows installations.) In such a case, and if the filename refers to an existing file, and the file system stores alternate short (8.3) names for directory entries, the short form of the filename is returned. Note that the "short" name might in fact be longer than the Unicode name if the Unicode name has very short pathname components containing non-ASCII characters. If no system codepage name for the file is possible, NULL is returned. The return value is dynamically allocated and should be freed with g_free() when no longer needed. Since 2.8

class WindowsUtils
static
string
localeFilenameFromUtf8
()

Parameters

utf8filename string

a UTF-8 encoded filename.

Return Value

Type: string

The converted filename, or NULL on conversion failure and lack of short names.

Meta