On 10/11/2011 09:37 PM, Hans-Peter Diettrich wrote:
IMO, calling ToLower with a string that is set to the encoding "RawByte" does not make sense and should generate an exception.

Nope.

A new string consists of a record that contains the encoding ID, element size, reference count, length and the pointger to the content:

  TAnsiRec = Packed Record
    CodePage    : TSystemCodePage;
    ElementSize : Word;
{$ifdef CPU64}
    { align fields  }
    Dummy       : DWord;
{$endif CPU64}
    Ref         : SizeInt;
    Len         : SizeInt;
    First       : AnsiChar;
  end;

So each string variable has it's own dedicated encoding ID and can't point to that of another string.

-Michael
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to