Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

AEncoding

About

AEncoding is a small unit, which partly replaces LazUtils.LConvEncoding. It provides a few functions for converting strings from/to some encoding schemes:

pascal
function AEncodingConvertFromUTF8(const AInput: RawByteString; out AOutput: RawByteString;
  AEnc: TSystemCodePage): boolean; inline;

function AEncodingConvertToUTF8(const AInput: RawByteString; out AOutput: RawByteString;
  AEnc: TSystemCodePage): boolean; inline;

function AEncodingConvertFromTo(const AInput: RawByteString; out AOutput: RawByteString;
  AEncInput, AEncOutput: TSystemCodePage): boolean;

To use functions with "string" var, do this:

text
 AEncoding....(RawByteString(S), ....);

Why "partly replaces"?

It also gives few integer constants aeid_NNNN for common encodings.

Download

GitHub: https://github.com/Alexey-T/AEncoding


From the Free Pascal wiki, page "AEncoding", as it stood on 2023-12-22 after a change by Alextpp, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 3, last changed by WikiArchive .