[fpc-devel] String and UnicodeString and UTF8Stringt

Michael Schnell mschnell at lumino.de
Tue Jan 11 11:30:12 CET 2011


On 01/11/2011 10:47 AM, Marco van de Voort wrote:
> But it also required the input granularity (1,2
> maybe 4) to be a variable.
Sorry I don't understand what you mean with this.
> Embacadero however decided otherwise and kept a wall between the 1 and 2
> byte types. So at least 1 and 2 byte types as basetype are different
> targets.
Unfortunately I don't have Delphi > 2007. From what O read I understand 
that the dynamically code string type can hold 1, 2, and 4 byte (maybe 
even more) Codes for it's elements (denoted in one control-value) and 
each of those (theoretically) in different coding schemes (denoted in 
another control-value), allowing e.g. for UTF-8, UTF-16, UCS4, German 
ANSI, raw Byte, string....

Each assignment would auto recode the string "if necessary". I suppose 
that s1 := s2 would not do any recoding, but s1 := s2 + s3; would 
automatically synchronize the coding.

I suppose there are ways do define the coding (and force recoding), 
maybe similar to "setlength(s, 10)".

-Michael



More information about the fpc-devel mailing list