Sign in Join
Wiki copytemporary

AEncoding: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11# About
22
33**AEncoding** is a small unit, which partly replaces LazUtils.LConvEncoding. It provides a few functions for converting strings from/to some encoding schemes:
44
55``` pascal
66function AEncodingConvertFromUTF8(const AInput: RawByteString; out AOutput: RawByteString;
77 AEnc: TSystemCodePage): boolean; inline;
88
99function AEncodingConvertToUTF8(const AInput: RawByteString; out AOutput: RawByteString;
1010 AEnc: TSystemCodePage): boolean; inline;
1111
1212function AEncodingConvertFromTo(const AInput: RawByteString; out AOutput: RawByteString;
1313 AEncInput, AEncOutput: TSystemCodePage): boolean;
1414```
1515
1616To use functions with "string" var, do this:
1717
18-```
18+```text
1919 AEncoding....(RawByteString(S), ....);
2020```
2121
2222Why "partly replaces"?
2323
2424- It uses FPC 3.x SetCodePage, which requires OS support for many encodings, whereas LConvEncoding doesn't require OS support. For common encodings (CP1250...CP1258, CP437, CP866 etc) OS support should work, on Windows and Unix'es.
2525- FPC SetCodePage doesn't raise exceptions, while LConvEncoding can do it (when global variable is set in LConvEncoding unit).
2626
2727It also gives few integer constants aeid_NNNN for common encodings.
2828
2929- Author: Alexey Torgashin.
3030- License: MPL 2.0 or LGPL.
3131
3232# Download
3333
3434GitHub: <https://github.com/Alexey-T/AEncoding>
3535
3636---
3737*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](/wiki-contact).*
3838Category: Unicode

Back to history