[fpc-devel] Encoded AnsiString
jonas.maebe at elis.ugent.be
Sun Dec 29 17:52:21 CET 2013
On 29 Dec 2013, at 16:25, Hans-Peter Diettrich wrote:
> I've heard that a mix of encodings converts the (concatenated) output (RawByteString?) to CP_ACP, with possible losses. Is this correct?
The code page of ansistrings concatenations is the code page of the result to which this concatenation is assigned/converted. For rawbytestring, this code page is CP_ACP per Delphi compatibility.
I'm inclined to add a global boolean variable to the system unit that allows changing this behaviour so that it uses CP_UTF8 instead in such cases (defaulting to false, for Delphi compatibility). In practice, setting it to true shouldn't cause problems even with virtually all Delphi, as routines that work with rawbytestring should be able to handle any code page anyway.
More information about the fpc-devel