Re: Converting WideChar/WideString to AnsiChar/AnsiString
- From: Rob Kennedy <me3@xxxxxxxxxxx>
- Date: Thu, 29 May 2008 07:41:40 -0500
ckoegl wrote:
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)?
I suppose that for all WideChar values that are valid AnsiChar values
(i.e. the ones with Ord-values of 0 to 255) are preserved in the
conversion, but what about the rest?
They're truncated, I think. Or it's a range-check error.
Converting a WideString to an AnsiString involves converting the WideString to the current system code page, but I'm pretty sure that effort is *not* used for converting WideChar to AnsiChar.
And if that's the case, then the conversion is nonsense. Don't do it.
--
Rob
.
- Follow-Ups:
- References:
- Prev by Date: Converting WideChar/WideString to AnsiChar/AnsiString
- Next by Date: Re: Converting WideChar/WideString to AnsiChar/AnsiString
- Previous by thread: Converting WideChar/WideString to AnsiChar/AnsiString
- Next by thread: Re: Converting WideChar/WideString to AnsiChar/AnsiString
- Index(es):
Relevant Pages
|