Desktop Functions: Smart Device Functions:
|
Search Results for "EnumSystemCodePages" in [All]kernel32
static extern bool EnumSystemCodePages(EnumCodePagesProcDlgt lpCodePageEnumProc, I needed to enumerate the installed code pages on a Windows machine, and wanted to present the possible encoding interpretations to a user via a ComboBox. By using the Win32 API ::EnumSystemCodePages() via PInvoke, and the System.Text.Encoding.GetEncoding() static method, I could get the mapping from the code page to an Encoding instance which returns "pretty" names like 'Japanese (Shift-JIS)'.
if (!EnumSystemCodePages(dlgt, CP_INSTALLED))
Debug.WriteLine(string.Format("EnumSystemCodePages failed with errno = {0}", errno));
private static extern bool EnumSystemCodePages(EnumCodePagesProcDlgt lpCodePageEnumProc, uint dwFlags); |