[fpc-devel] Save the current FPC UnicodeString!

Paul Ishenin webpirat at mail.ru
Fri Nov 13 00:41:51 CET 2009


Martin Schreiber wrote:
> UnicodeString
> - always utf-16 encoded.
> - str:= 'abc'; length(str) = 6, stringcodepage(str) = 1200.
> - str:= 'abä'; length(str) = 6, stringcodepage(str) = 1200.
> - no encoding checks by concanteation, concatenation does not work because of 
> wrong length() value.
> - setlength() of empty string creates CP 1200.
>   
Length needs to be fixed. I know about the bug but had not looked at it yet.
> What are the differences of AnsiString and RawByteString?
>   
AnsiString has code page assigned to current system encoding. You can 
change it though using SetMultiByteConversionCodePage routine. 
RawByteString has no encoding. Therefore assigning to AnsiString 
converts right operand to AnsiString encoding first. Assigning to 
RawByteString does not invoke any conversion and as result of assigning 
RawByteString left operand will get the encoding or right operand.

Best regards,
Paul Ishenin.



More information about the fpc-devel mailing list