On 08.01.2014 19:57, Hans-Peter Diettrich wrote:
Sven Barth schrieb:
Am 08.01.2014 15:58 schrieb "Hans-Peter Diettrich"
<drdiettri...@aol.com <mailto:drdiettri...@aol.com>>:
> Delphi concatenates RawByteStrings to the dynamic encoding of the
*first* string, the appended strings eventually are converted before
concatenation. Special handling of strings with the same encoding is
not required.
> I.e. the result is *not* always a CP_ACP string, as documented in
the wiki.
Would you be so kind to provide a simple test case for this? :)
function test(a,b: RawByteString): RawByteString;
begin
Result := a+b;
WriteLn(StringCodePage(Result));
end;
var
u: UTF8String;
a: AnsiString;
begin
a := 'äöü';
u := 'üöä';
test(a,u); //CP_ACP
test(u,a); //UTF-8
end;
It looks to me, however, that no conversion occurs at all!
The strings are only concatenated as they are.
Same for a concatenation of (global) RawByteString variables.
This of course were not a desireable implementation :-(
I'm inclined to say "of course", because in your "test" function you are
concatenating two RawByteStrings which - by definition - don't do any
conversion.
Regards,
Sven
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel