Re: WebGetPostData converts characters to HTML
2-22-24
Hi, have same problem. I have a temporary solution with HAL. But think is better to fix this in core.

procedure ReplaceWebStrings(var string tstr,var longint movcnt)
begin
integer i,l;

l = len(tstr);
movcnt = 0;
for (i = 0; i < l;i = i + 1) begin
movcnt = movcnt + 1;
if mid(tstr,i,4)=="<" then begin
tstr = left(tstr,i) & "<" & right(tstr,l-i-4);
l = l - 3;
movcnt = movcnt + 3;
end;
if mid(tstr,i,4)==">" then begin
tstr = left(tstr,i) & ">" & right(tstr,l-i-4);
l = l - 3;
movcnt = movcnt + 3;
end;
if mid(tstr,i,6)=="'" then begin
tstr = left(tstr,i) & "'" & right(tstr,l-i-6);
l = l - 5;
movcnt = movcnt + 5;
end;
if mid(tstr,i,6)==""" then begin
tstr = left(tstr,i) & "\"" & right(tstr,l-i-6);
l = l - 5;
movcnt = movcnt + 5;
end;
if movcnt>220 then begin
tstr = left(tstr,len(tstr)-(255-movcnt));
i = l;
end;
end;

return;
end;

global
procedure FixAreaWebStrings(var area FileArea)
begin
area newArea;
string 255 tstr;
longint asize,pos,movcnt;

SetAreaZeroSize(newArea);
asize = GetAreaLength(FileArea);

pos = 0;
while pos < asize begin
tstr = GetStringFromArea(FileArea,pos,255);
ReplaceWebStrings(tstr,movcnt);
pos = pos + movcnt;
if movcnt==0 then begin
pos = pos + 1;
end;
AddTextToArea(tstr,newArea);
end;
SetAreaZeroSize(FileArea);
InsertAreaBeforeArea(newArea,FileArea);
return;
end;

global webpublic procedure WebGetJSON()
begin
area reqst;
json jobj;

webgetpostdata(reqst);
FixAreaWebStrings(reqst);
jobj = parsejsonarea(reqst);

return;
end;
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Latest Posts
Hello Erdogdu, I am very sorry for the late answer, The answer is Yes, it&apos;s fix . my suggestion, if possible to be setting with bank fee code ...
09:24 23 July 2024
Andis Blicāns, Grasko
The above applies to the window when it is opened for the first time. If the window is already open and I choose Window/Restore Position, the window takes the correct position. Namely, the upper left ...
00:43 18 July 2024