Browse Source

+ Fixed ansistring -> widestring conversion issue (bugrep 3013)

michael 21 năm trước cách đây
mục cha
commit
0768cc1cd6
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      fcl/inc/xmlreg.pp

+ 4 - 2
fcl/inc/xmlreg.pp

@@ -278,6 +278,7 @@ Var
   DataNode : TDomNode;
   ND : Integer;
   Dt : TDataType;
+  S : AnsiString;
   
 begin
   Node:=FindValueKey(Name);
@@ -299,9 +300,10 @@ begin
                     DataSize:=SizeOf(Cardinal);
                     end;
           dtString : begin
-                     DataSize:=Length(DataNode.NodeValue);
+                     S:=DataNode.NodeValue; // Convert to ansistring 
+                     DataSize:=Length(S);
                      If (DataSize>0) then
-                       Move(DataNode.NodeValue[1],Data,DataSize);
+                       Move(S[1],Data,DataSize);
                      end;  
           dtBinary : begin
                      DataSize:=Length(DataNode.NodeValue);