Using Dephi's built-in AnsiString charset support is best:
type // ISO-8859-1 and Windows-1252 are NOT the same, but // are commonly interchanged when they should not be! Latin1String = type AnsiString(28591); Windows1252String = type AnsiString(1252); GreekString = type AnsiString(1253);
procedure DoIt; var S1: Latin1String; S2: Windows1252String; S3: GreekString; begin S1 := '...'; // auto-converts to ISO-8859-1 S2 := S1; // auto-converts from ISO-8859-1 to Unicode to Windows-1252 S3 := S1; // auto-converts from ISO-8859-1 to Unicode to Greek end;
---------- see about usage of MultiByteToWideChar(...) <=> WideCharToMultiByte(...)
https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
see unit "IdCharsets.pas" with Charset names GB2312 - 936 - chinese simplified
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
see here a sample about convert charsets using SQLite and Delphi
SQLite Character Encodings Converting from ANSI to UTF8
https://1st.bitbumper.de/sqlite-ansi-utf8/
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3