Re: Converting WideChar/WideString to AnsiChar/AnsiString
- From: "Rudy Velthuis" <newsgroups@xxxxxxxxxxxx>
- Date: Thu, 29 May 2008 23:07:27 +0000 (UTC)
ckoegl wrote:
Hi,
I cannot find anything definitive in the Delphi docs and in the
relevant newsgroups that answers this simple question:
What is the exact definition of the WideChar to AnsiChar conversion
(and in extension of the WideString to AnsiString conversion)?
The RTL basically uses this:
function CharFromWChar(CharDest: PChar; DestBytes: Integer; const
WCharSource: PWideChar; SrcChars: Integer): Integer;
begin
Result := WideCharToMultiByte(DefaultSystemCodePage, 0,
WCharSource, SrcChars,
CharDest, DestBytes, nil, nil);
end;
--
Rudy Velthuis http://rvelthuis.de
"Beware of bugs in the above code; I have only proven it correct,
not tried it." -- Donald E. Knuth.
.
- References:
- Prev by Date: Re: Name of executable
- Next by Date: Re: Converting WideChar/WideString to AnsiChar/AnsiString
- Previous by thread: Re: Converting WideChar/WideString to AnsiChar/AnsiString
- Next by thread: Can't find Password property in nmsmtp object in Delphi 5
- Index(es):