nickycheng
asked on
How do I convert a WideString to String...?
<-
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What is this codePage?
I didn't understand
I didn't understand
var
l: integer;
begin
if ws = '' then
Result := ''
else begin
l := WideCharToMultiByte(codePa
WC_COMPOSITECHECK or WC_DISCARDNS or WC_SEPCHARS or WC_DEFAULTCHAR,
@ws[1], -1, nil, 0, nil, nil);
SetLength(Result, l-1);
if l > 1 then
WideCharToMultiByte(codePa
WC_COMPOSITECHECK or WC_DISCARDNS or WC_SEPCHARS or WC_DEFAULTCHAR,
@ws[1], -1, @Result[1], l-1, nil, nil);
end;
end;