I'm looking for a Win32 equivalent of the .Net Encoding.GetEncoding Method to be used in Delphi7.
What I would like to achieve is to convert a Codepage ID (ie.: 28592) to a Codepage name (iso-8859-2 in this case).
I've found a Win32 function called GetCPInfoEx, but that returns a long CodePage name, and I need the short one, like the ones listed on this page: (see Name column) http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx
Thank you!
Use search, Luke. Just old good text search. In RegEdit. For any cp short name you'd need :-) and remember, those IDs are really Internet MIME ids
HKEY_CLASSES_ROOT\MIME\DataBase
http://msdn.microsoft.com/en-us/library/ms775147.aspx this page hints that probably - just probably - that key exists since MSIE4 - in other words since Windows 98
You need to use IMultiLanguage::GetCodePageInfo, exported as part of MLang.dll. It's included with IE4 and above. You can create the import library yourself using Delphi's Import Component... command, or grab MultiLanguage_TLB.pas from Colin Wilson's low-level utilities package.
Here is my look-up table with code, feel free to use it.
Thanks to everyone for the answers, but this proved to be the only usable solution in this case...
Are you looking for the IANA official names? Since you want them correlated to Windows CP identifiers, I don't think you can do better than this table.
I think you mean the LCIDToLocaleName function.