You are here: PSPad forum > English discussion forum > Feature request: all codepages provided by Windows
Posted by: Freeman | Date: 2008-07-15 00:43 | IP: IP Logged
Unfortunately, PSPad is not an open source, so I have forced to tell you how to make it yourself.
Just walk programmatically on HKEY_CLASSES_ROOT\Mime\Database\Codepage key and enumerate it's subkeys - these names are appropriate codepage values. For each subkey you can read the Description value - this string can be added to codepages menu. When needed for suitable HTML encoding, read the WebCharset value, if exists, otherwise the BodyCharset value.
Reverse conversion is possible via help of neighbor HKEY_CLASSES_ROOT\Mime\Database\Charset key.
IMHO, these registry entires are used by IE. Windows supports all the codepages natively, via MultiByteToWideChar/WideCharToMultiByte functions. For example, code 20866 results Cyrillic KOI8-R conversion, not elsewhere provided by the system (I don't know, at least ).
And, please, don't use of OemToChar/OemToCharBuff/CharToOem/CharToOemBuff working with Unicode characters - they cause problems like this or that.
IMHO, use of descripted registry database can solve all of encode/codepages problems once and for all.
Posted by: Freeman | Date: 2014-11-28 23:04 | IP: IP Logged
This feature can be implemented using MLang helper in modern versions of Delphi, backported to Delphi 6/7 by Gunsmoker. IEnumCodePage examples: Russian, English.
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR