potrzebuję zakodować tekst do Unicode. Znalazłem w pomocy Buildera funkcje
Utf8ToUnicode, jednak nie za bardzo potrafie jej uzyc. Kiepsko u mnie z angielskim.
Mam dwa obiekty na formie RichEdit1 - gdzie jest tekst ANSI oraz RichEdit2 - w którym miałby sie wyswietlić tekst Unicode.
Na początku rzecz jasna należałoby zrobic kodowanie RichEdit1 do UTF8, ale to juz nie jest problem, jest na to funkcja AnsiToUtf8.
Pomoc mówi:
Converts a string of UTF-8 characters to a Unicode string.
- Kod: Zaznacz cały
int Utf8ToUnicode(PWideChar Dest, PChar Source, int MaxChars);
Cardinal Utf8ToUnicode(PWideChar Dest, Cardinal MaxDestChars, PChar Source, Cardinal SourceBytes);
Call Utf8ToUnicode to convert a UTF-8 string to Unicode. Use the first syntax. The second syntax is provided for backward compatibility only.
Dest receives the resulting null-terminated array of Unicode characters.
MaxDestChars or MaxChars indicates the maximum number of Unicode characters that the buffer specified by Dest can hold, not counting the null terminator.
Source is an array of UTF-8 characters.
SourceBytes is the number of bytes in Source. If SourceBytes is not specified, Source must be null-terminated.
Utf8ToUnicode returns the number of characters written to Dest.
In case of errors, the Utf8ToUnicode ... : Cardinal variant returns Cardinal(-1) == $FFFFFFFF and the Utf8ToUnicode ... : Integer returns -1.
Bedę wdzięczny za pomoc.



