Skip to content

Commit

Permalink
Храним данные в utf8 в переменных AnsiString rtti зкада. fix #107 про…
Browse files Browse the repository at this point in the history
…должение 4222abd
  • Loading branch information
zamtmn committed Mar 26, 2024
1 parent 3daef46 commit 214a56f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
14 changes: 7 additions & 7 deletions cad_source/components/zscript/UBaseTypeDescriptor.pas
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

unit UBaseTypeDescriptor;

{$MODE DELPHI}
{$MODE DELPHI}{$Codepage UTF8}
interface
uses
typinfo,LCLProc,Graphics,classes,Themes,
Expand Down Expand Up @@ -363,36 +363,36 @@ class procedure TFloatTypeManipulator<T>.setFormattedValueAsString(var data:T; c
end;
class function TStringTypeManipulator<T>.GetValueAsString(const data:T):TInternalScriptString;
begin
result:=uni2cp(data);
result:={uni2cp}(data);
end;
class function TStringTypeManipulator<T>.GetFormattedValueAsString(const data:T; const f:TzeUnitsFormat):TInternalScriptString;
begin
result:=GetValueAsString(data);
end;
class procedure TStringTypeManipulator<T>.SetValueFromString(var data:T;Value:TInternalScriptString);
begin
data:=cp2uni(Value);
data:={cp2uni}(Value);
end;
class procedure TStringTypeManipulator<T>.setFormattedValueAsString(var data:T; const f:TzeUnitsFormat;Value:TInternalScriptString);
begin
data:=cp2uni(Value);
data:={cp2uni}(Value);
end;

class function TAnsiStringTypeManipulator<T>.GetValueAsString(const data:T):TInternalScriptString;
begin
result:=ansi2cp(data);
result:={ansi2cp}(data);;
end;
class function TAnsiStringTypeManipulator<T>.GetFormattedValueAsString(const data:T; const f:TzeUnitsFormat):TInternalScriptString;
begin
result:=GetValueAsString(data);
end;
class procedure TAnsiStringTypeManipulator<T>.SetValueFromString(var data:T;Value:TInternalScriptString);
begin
data:=cp2ansi(Value);
data:={cp2ansi}(Value);
end;
class procedure TAnsiStringTypeManipulator<T>.setFormattedValueAsString(var data:T; const f:TzeUnitsFormat;Value:TInternalScriptString);
begin
data:=cp2uni(Value);
data:={cp2uni}(Value);
end;


Expand Down
6 changes: 3 additions & 3 deletions cad_source/components/zscript/langsystem.pas
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

unit langsystem;

{$MODE DELPHI}
{$MODE DELPHI}{$Codepage UTF8}
interface
uses uzbstrproc,varmandef,UBaseTypeDescriptor,
base64;
Expand Down Expand Up @@ -359,8 +359,8 @@ function TAnsiString_let_TString(var rez, hrez: vardesk): vardesk;
rez.SetInstance(FundamentalStringDescriptorObj.AllocAndInitInstance);
end else
AnsiString(rez.data.Addr.Instance^):='';
AnsiString(result.data.Addr.Instance^) := Tria_Utf8ToAnsi(String(hrez.data.Addr.Instance^));
AnsiString(rez.data.Addr.Instance^) := Tria_Utf8ToAnsi(String(hrez.data.Addr.Instance^));
AnsiString(result.data.Addr.Instance^) := {Tria_Utf8ToAnsi}(String(hrez.data.Addr.Instance^));
AnsiString(rez.data.Addr.Instance^) := {Tria_Utf8ToAnsi}(String(hrez.data.Addr.Instance^));
end;
function TAnsiString_let_TAnsiString(var rez, hrez: vardesk): vardesk;
begin
Expand Down
12 changes: 6 additions & 6 deletions cad_source/zcad/commands/uzccommand_drawsuperline.pas
Original file line number Diff line number Diff line change
Expand Up @@ -299,18 +299,18 @@ procedure createline;

if operands = '1' then
begin
hotkeyname:=Tria_AnsiToUtf8(DrawSuperlineParams.SLSetting1);
hotkeytypeline:=Tria_AnsiToUtf8(DrawSuperlineParams.SLSettingTypeLine1);
hotkeyname:={Tria_AnsiToUtf8}(DrawSuperlineParams.SLSetting1);
hotkeytypeline:={Tria_AnsiToUtf8}(DrawSuperlineParams.SLSettingTypeLine1);
end;
if operands = '2' then
begin
hotkeyname:=Tria_AnsiToUtf8(DrawSuperlineParams.SLSetting2);
hotkeytypeline:=Tria_AnsiToUtf8(DrawSuperlineParams.SLSettingTypeLine2);
hotkeyname:={Tria_AnsiToUtf8}(DrawSuperlineParams.SLSetting2);
hotkeytypeline:={Tria_AnsiToUtf8}(DrawSuperlineParams.SLSettingTypeLine2);
end;
if operands = '3' then
begin
hotkeyname:=Tria_AnsiToUtf8(DrawSuperlineParams.SLSetting3);
hotkeytypeline:=Tria_AnsiToUtf8(DrawSuperlineParams.SLSettingTypeLine3);
hotkeyname:={Tria_AnsiToUtf8}(DrawSuperlineParams.SLSetting3);
hotkeytypeline:={Tria_AnsiToUtf8}(DrawSuperlineParams.SLSettingTypeLine3);
end;

//ZCMsgCallBackInterface.TextMessage('hotkeyname:'+hotkeyname,TMWOHistoryOut);
Expand Down
2 changes: 1 addition & 1 deletion cad_source/zcad/commands/uzccommand_numdevices.pas
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ procedure FillMetrixDictionary(var md:TMetrixDictionary);
pvd:=pdevvarext.entityunit.FindVariable('NMO_BaseName');
if pvd<>nil then begin
if uppercase(pvd^.data.PTD^.GetUserValueAsString(pvd^.data.Addr.Instance))=
uppercase(Tria_AnsiToUtf8(NumberingParams.BaseName)) then
uppercase({Tria_AnsiToUtf8}(NumberingParams.BaseName)) then
process:=true
else begin
process:=false;
Expand Down
1 change: 1 addition & 0 deletions cad_source/zcad/register/uzcregnavigatordevices.pas
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
}

unit uzcregnavigatordevices;
{$Codepage UTF8}
{$INCLUDE zengineconfig.inc}
interface
uses uzcfnavigatordevices,uzcfcommandline,uzbpaths,TypeDescriptors,uzctranslations,Forms,
Expand Down

0 comments on commit 214a56f

Please sign in to comment.