{
pascalx.io.charset.rtlang — модуль поддержки кодировок для текущей локали
приложения.
Copyright © 2021, 2026 Малик Разработчик
Это свободная программа: вы можете перераспространять её и/или
изменять её на условиях Меньшей Стандартной общественной лицензии GNU в том виде,
в каком она была опубликована Фондом свободного программного обеспечения;
либо версии 3 лицензии, либо (по вашему выбору) любой более поздней версии.
Эта программа распространяется в надежде, что она может быть полезна,
но БЕЗО ВСЯКИХ ГАРАНТИЙ; даже без неявной гарантии ТОВАРНОГО ВИДА
или ПРИГОДНОСТИ ДЛЯ ОПРЕДЕЛЁННЫХ ЦЕЛЕЙ. Подробнее см. в Меньшей Стандартной
общественной лицензии GNU.
Вы должны были получить копию Меньшей Стандартной общественной лицензии GNU
вместе с этой программой. Если это не так, см.
<http://www.gnu.org/licenses/>.
}
unit pascalx.io.charset.rtlang;
{$MODE DELPHI}
interface
{%region} uses
pascalx.io.charset.eightbit;
{%endregion}
{$TYPEINFO ON}
{$CALLING REGISTER}
{%region} type
CP1251 = class;
ISO8859_5 = class;
KOI8_R = class;
KOI8_RU = class;
KOI8_U = class;
Macintosh = class;
OEM855 = class;
OEM866 = class;
CP1251 = class sealed(EightBitCharset)
public
constructor create();
end;
ISO8859_5 = class sealed(EightBitCharset)
public
constructor create();
end;
KOI8_R = class sealed(EightBitCharset)
public
constructor create();
end;
KOI8_RU = class sealed(EightBitCharset)
public
constructor create();
end;
KOI8_U = class sealed(EightBitCharset)
public
constructor create();
end;
Macintosh = class sealed(EightBitCharset)
public
constructor create();
end;
OEM855 = class sealed(EightBitCharset)
public
constructor create();
function displayName(): UnicodeString; override;
end;
OEM866 = class sealed(EightBitCharset)
public
constructor create();
function displayName(): UnicodeString; override;
end;
{%endregion}
implementation
{$CALLING REGISTER}
{%region CP1251 }
constructor CP1251.create();
begin
inherited create('CP1251', [ 'CP-1251', 'CP 1251', 'Windows1251', 'Windows-1251', 'Windows 1251' ],
#$0402#$0403#$201a#$0453#$201e#$2026#$2020#$2021#$20ac#$2030#$0409#$2039#$040a#$040c#$040b#$040f +
#$0452#$2018#$2019#$201c#$201d#$2022#$2013#$2014#$0000#$2122#$0459#$203a#$045a#$045c#$045b#$045f +
#$00a0#$040e#$045e#$0408#$00a4#$0490#$00a6#$00a7#$0401#$00a9#$0404#$00ab#$00ac#$00ad#$00ae#$0407 +
#$00b0#$00b1#$0406#$0456#$0491#$00b5#$00b6#$00b7#$0451#$2116#$0454#$00bb#$0458#$0405#$0455#$0457 +
#$0410#$0411#$0412#$0413#$0414#$0415#$0416#$0417#$0418#$0419#$041a#$041b#$041c#$041d#$041e#$041f +
#$0420#$0421#$0422#$0423#$0424#$0425#$0426#$0427#$0428#$0429#$042a#$042b#$042c#$042d#$042e#$042f +
#$0430#$0431#$0432#$0433#$0434#$0435#$0436#$0437#$0438#$0439#$043a#$043b#$043c#$043d#$043e#$043f +
#$0440#$0441#$0442#$0443#$0444#$0445#$0446#$0447#$0448#$0449#$044a#$044b#$044c#$044d#$044e#$044f
);
end;
{%endregion}
{%region ISO8859_5 }
constructor ISO8859_5.create();
begin
inherited create('ISO 8859-5', [ 'ISO8859-5', 'Windows-28595' ],
#$0080#$0081#$0082#$0083#$0084#$0085#$0086#$0087#$0088#$0089#$008a#$008b#$008c#$008d#$008e#$008f +
#$0090#$0091#$0092#$0093#$0094#$0095#$0096#$0097#$0098#$0099#$009a#$009b#$009c#$009d#$009e#$009f +
#$00a0#$0401#$0402#$0403#$0404#$0405#$0406#$0407#$0408#$0409#$040a#$040b#$040c#$00ad#$040e#$040f +
#$0410#$0411#$0412#$0413#$0414#$0415#$0416#$0417#$0418#$0419#$041a#$041b#$041c#$041d#$041e#$041f +
#$0420#$0421#$0422#$0423#$0424#$0425#$0426#$0427#$0428#$0429#$042a#$042b#$042c#$042d#$042e#$042f +
#$0430#$0431#$0432#$0433#$0434#$0435#$0436#$0437#$0438#$0439#$043a#$043b#$043c#$043d#$043e#$043f +
#$0440#$0441#$0442#$0443#$0444#$0445#$0446#$0447#$0448#$0449#$044a#$044b#$044c#$044d#$044e#$044f +
#$2116#$0451#$0452#$0453#$0454#$0455#$0456#$0457#$0458#$0459#$045a#$045b#$045c#$00a7#$045e#$045f
);
end;
{%endregion}
{%region KOI8_R }
constructor KOI8_R.create();
begin
inherited create('KOI8-R', [ 'KOI8 R', 'KOI8R', 'Windows-20866' ],
#$2500#$2502#$250c#$2510#$2514#$2518#$251c#$2524#$252c#$2534#$253c#$2580#$2584#$2588#$258c#$2590 +
#$2591#$2592#$2593#$2320#$25a0#$2219#$221a#$2248#$2264#$2265#$00a0#$2321#$00b0#$00b2#$00b7#$00f7 +
#$2550#$2551#$2552#$0451#$2553#$2554#$2555#$2556#$2557#$2558#$2559#$255a#$255b#$255c#$255d#$255e +
#$255f#$2560#$2561#$0401#$2562#$2563#$2564#$2565#$2566#$2567#$2568#$2569#$256a#$256b#$256c#$00a9 +
#$044e#$0430#$0431#$0446#$0434#$0435#$0444#$0433#$0445#$0438#$0439#$043a#$043b#$043c#$043d#$043e +
#$043f#$044f#$0440#$0441#$0442#$0443#$0436#$0432#$044c#$044b#$0437#$0448#$044d#$0449#$0447#$044a +
#$042e#$0410#$0411#$0426#$0414#$0415#$0424#$0413#$0425#$0418#$0419#$041a#$041b#$041c#$041d#$041e +
#$041f#$042f#$0420#$0421#$0422#$0423#$0416#$0412#$042c#$042b#$0417#$0428#$042d#$0429#$0427#$042a
);
end;
{%endregion}
{%region KOI8_RU }
constructor KOI8_RU.create();
begin
inherited create('KOI8-RU', [ 'KOI8 RU', 'KOI8RU' ],
#$2500#$2502#$250c#$2510#$2514#$2518#$251c#$2524#$252c#$2534#$253c#$2580#$2584#$2588#$258c#$2590 +
#$2591#$2592#$2593#$2320#$25a0#$2219#$221a#$2248#$2264#$2265#$00a0#$2321#$00b0#$00b2#$00b7#$00f7 +
#$2550#$2551#$2552#$0451#$0454#$2554#$0456#$0457#$2557#$2558#$2559#$255a#$255b#$0491#$045e#$255e +
#$255f#$2560#$2561#$0401#$0404#$2563#$0406#$0407#$2566#$2567#$2568#$2569#$256a#$0490#$040e#$00a9 +
#$044e#$0430#$0431#$0446#$0434#$0435#$0444#$0433#$0445#$0438#$0439#$043a#$043b#$043c#$043d#$043e +
#$043f#$044f#$0440#$0441#$0442#$0443#$0436#$0432#$044c#$044b#$0437#$0448#$044d#$0449#$0447#$044a +
#$042e#$0410#$0411#$0426#$0414#$0415#$0424#$0413#$0425#$0418#$0419#$041a#$041b#$041c#$041d#$041e +
#$041f#$042f#$0420#$0421#$0422#$0423#$0416#$0412#$042c#$042b#$0417#$0428#$042d#$0429#$0427#$042a
);
end;
{%endregion}
{%region KOI8_U }
constructor KOI8_U.create();
begin
inherited create('KOI8-U', [ 'KOI8 U', 'KOI8U', 'Windows-21866' ],
#$2500#$2502#$250c#$2510#$2514#$2518#$251c#$2524#$252c#$2534#$253c#$2580#$2584#$2588#$258c#$2590 +
#$2591#$2592#$2593#$2320#$25a0#$2219#$221a#$2248#$2264#$2265#$00a0#$2321#$00b0#$00b2#$00b7#$00f7 +
#$2550#$2551#$2552#$0451#$0454#$2554#$0456#$0457#$2557#$2558#$2559#$255a#$255b#$0491#$255d#$255e +
#$255f#$2560#$2561#$0401#$0404#$2563#$0406#$0407#$2566#$2567#$2568#$2569#$256a#$0490#$256c#$00a9 +
#$044e#$0430#$0431#$0446#$0434#$0435#$0444#$0433#$0445#$0438#$0439#$043a#$043b#$043c#$043d#$043e +
#$043f#$044f#$0440#$0441#$0442#$0443#$0436#$0432#$044c#$044b#$0437#$0448#$044d#$0449#$0447#$044a +
#$042e#$0410#$0411#$0426#$0414#$0415#$0424#$0413#$0425#$0418#$0419#$041a#$041b#$041c#$041d#$041e +
#$041f#$042f#$0420#$0421#$0422#$0423#$0416#$0412#$042c#$042b#$0417#$0428#$042d#$0429#$0427#$042a
);
end;
{%endregion}
{%region Macintosh }
constructor Macintosh.create();
begin
inherited create('Macintosh', [ 'MacCyrillic', 'Mac OS Cyrillic' ],
#$0410#$0411#$0412#$0413#$0414#$0415#$0416#$0417#$0418#$0419#$041a#$041b#$041c#$041d#$041e#$041f +
#$0420#$0421#$0422#$0423#$0424#$0425#$0426#$0427#$0428#$0429#$042a#$042b#$042c#$042d#$042e#$042f +
#$2020#$00b0#$0490#$00a3#$00a7#$2022#$00b6#$0406#$00ae#$00a9#$2122#$0402#$0452#$2260#$0403#$0453 +
#$221e#$00b1#$2264#$2265#$0456#$00b5#$0491#$0408#$0404#$0454#$0407#$0457#$0409#$0459#$040a#$045a +
#$0458#$0405#$00ac#$221a#$0192#$2248#$2206#$00ab#$00bb#$2026#$00a0#$040b#$045b#$040c#$045c#$0455 +
#$2013#$2014#$201c#$201d#$2018#$2019#$00f7#$201e#$040e#$045e#$040f#$045f#$2116#$0401#$0451#$044f +
#$0430#$0431#$0432#$0433#$0434#$0435#$0436#$0437#$0438#$0439#$043a#$043b#$043c#$043d#$043e#$043f +
#$0440#$0441#$0442#$0443#$0444#$0445#$0446#$0447#$0448#$0449#$044a#$044b#$044c#$044d#$044e#$20ac
);
end;
{%endregion}
{%region OEM855 }
constructor OEM855.create();
begin
inherited create('OEM855', [ 'OEM-855', 'OEM 855', 'CP855', 'CP-855', 'CP 855' ],
#$0452#$0402#$0453#$0403#$0451#$0401#$0454#$0404#$0455#$0405#$0456#$0406#$0457#$0407#$0458#$0408 +
#$0459#$0409#$045a#$040a#$045b#$040b#$045c#$040c#$045e#$040e#$045f#$040f#$044e#$042e#$044a#$042a +
#$0430#$0410#$0431#$0411#$0446#$0426#$0434#$0414#$0435#$0415#$0444#$0424#$0433#$0413#$00ab#$00bb +
#$2591#$2592#$2593#$2502#$2524#$0445#$0425#$0438#$0418#$2563#$2551#$2557#$255d#$0439#$0419#$2510 +
#$2514#$2534#$252c#$251c#$2500#$253c#$043a#$041a#$255a#$2554#$2569#$2566#$2560#$2550#$256c#$00a4 +
#$043b#$041b#$043c#$041c#$043d#$041d#$043e#$041e#$043f#$2518#$250c#$2588#$2584#$041f#$044f#$2580 +
#$042f#$0440#$0420#$0441#$0421#$0442#$0422#$0443#$0423#$0436#$0416#$0432#$0412#$044c#$042c#$2116 +
#$00ad#$044b#$042b#$0437#$0417#$0448#$0428#$044d#$042d#$0449#$0429#$0447#$0427#$00a7#$25a0#$00a0
);
end;
function OEM855.displayName(): UnicodeString;
begin
result := 'CP855';
end;
{%endregion}
{%region OEM866 }
constructor OEM866.create();
begin
inherited create('OEM866', [ 'OEM-866', 'OEM 866', 'CP866', 'CP-866', 'CP 866' ],
#$0410#$0411#$0412#$0413#$0414#$0415#$0416#$0417#$0418#$0419#$041a#$041b#$041c#$041d#$041e#$041f +
#$0420#$0421#$0422#$0423#$0424#$0425#$0426#$0427#$0428#$0429#$042a#$042b#$042c#$042d#$042e#$042f +
#$0430#$0431#$0432#$0433#$0434#$0435#$0436#$0437#$0438#$0439#$043a#$043b#$043c#$043d#$043e#$043f +
#$2591#$2592#$2593#$2502#$2524#$2561#$2562#$2556#$2555#$2563#$2551#$2557#$255d#$255c#$255b#$2510 +
#$2514#$2534#$252c#$251c#$2500#$253c#$255e#$255f#$255a#$2554#$2569#$2566#$2560#$2550#$256c#$2567 +
#$2568#$2564#$2565#$2559#$2558#$2552#$2553#$256b#$256a#$2518#$250c#$2588#$2584#$258c#$2590#$2580 +
#$0440#$0441#$0442#$0443#$0444#$0445#$0446#$0447#$0448#$0449#$044a#$044b#$044c#$044d#$044e#$044f +
#$0401#$0451#$0404#$0454#$0407#$0457#$040e#$045e#$00b0#$2219#$00b7#$221a#$2116#$00a4#$25a0#$00a0
);
end;
function OEM866.displayName(): UnicodeString;
begin
result := 'CP866';
end;
{%endregion}
{%region} initialization
EightBitCharset.register(CP1251.create());
EightBitCharset.register(ISO8859_5.create());
EightBitCharset.register(KOI8_R.create());
EightBitCharset.register(KOI8_RU.create());
EightBitCharset.register(KOI8_U.create());
EightBitCharset.register(Macintosh.create());
EightBitCharset.register(OEM855.create());
EightBitCharset.register(OEM866.create());
{%endregion}
end.