Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- US1, US2: UTF8String;
- MStream: TMemoryStream;
- begin
- US1 := AnsiToUtf8(Memo1.Text);
- Memo1.Clear;
- MStream := TMemoryStream.Create;
- MStream.Write(PUTF8String(US1)^, Length(US1));
- SetLength(US2, MStream.Size);
- MStream.Position := 0;
- MStream.Read(PUTF8String(US2)^, MStream.Size);
- Memo1.Text := Utf8ToAnsi(US2);
- MStream.Free;
Add Comment
Please, Sign In to add comment