====== pears.IQXNetDecodePostValue ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create function "pears"."IQXNetDecodePostValue"(
/* Application Maintained Function / Procedure - DO NOT EDIT*/
in "pdata" char(250) )
returns char(250)
begin
declare "rv" char(250);
declare "i" smallint;
declare "l" smallint;
declare "c" smallint;
declare "s" char(3);
set "rv" = '';
set "l" = "length"("pdata");
set "i" = 1;
while "i" <= "l" loop
set "s" = "substr"("pdata","i",1);
set "i" = "i"+1;
if "s" = '+' then
set "s" = ' '
else if "s" = '%' then
set "c" = "hextoint"("substr"("pdata","i",2));
set "i" = "i"+2;
if "c" = 194 then // utf-8 2 byte code
set "s" = ''
else
set "s" = "char"("c")
end if end if end if;
set "rv" = "rv"+"s"
end loop;
return "rv"
end