Storing UTF8 string in a UnicodeString
- by Mick
In Delphi 2007 you can store a UTF8 string in a WideString and then pass that onto a Win32 function, e.g.
var
UnicodeStr: WideString;
UTF8Str: WideString;
begin
UnicodeStr:='some unicode text';
UTF8Str:=UTF8Encode(UnicodeStr);
Windows.SomeFunction(PWideChar(UTF8Str), ...)
end;
Delphi 2007 does not interfere with the contents of…