Arno Garrels wrote:
> Busai Péter wrote:
>> In HttpAppServer, URLHandler
>>
>> Call
>> Client.AnswerPage(Flags,'','','template.html',nil,['SOMEKEY','A']);
>>
>> The value of SOMEKEY must be one character long.
>>
>> Result rendered in html page:
>> Unsupported TVarRec.VType = vtWideChar
>
> I uploaded changed versions of OverbyteIcsHttpSrv.pas and
> OverbyteIcsHttpAppServer.pas here:
> http://www.duodata.de/misc/delphi/ics/OverbyteIcsHttpSrv733.zip
>
> Fixed VarRecToString. AnswerPage and other functions take
> optional codepage parameters now, you asked that some days back.
> So it should now be possible to write i.e. UTF-8 encoded HTML
> by passing CP_UTF8 in parameter DstCodePage, the default is
> CP_ACP. Since it's not much tested please give it a trial and
> let me know how it works for you before I upload this change to
> the repository.
Just in case you downloaded the wrong ZIP, VarRecToString should
look like:
function VarRecToString(V : TVarRec) : String;
const
BooleanToString : array [Boolean] of String = ('FALSE', 'TRUE');
begin
case V.VType of
vtInteger: Result := _IntToStr(V.VInteger);
vtBoolean: Result := BooleanToString[V.VBoolean];
vtChar: Result := String(V.VChar);
vtExtended: Result := _FloatToStr(V.VExtended^);
vtString: Result := String(V.VString^);
vtPointer: Result := 'Unsupported TVarRec.VType = vtPointer';
vtPChar: Result := String(_StrPas(V.VPChar));
vtObject: Result := 'Unsupported TVarRec.VType = vtObject';
vtClass: Result := 'Unsupported TVarRec.VType = vtClass';
vtWideChar: Result := String(V.VWideChar);
vtPWideChar: Result := String(V.VPWideChar);
vtAnsiString: Result := String(_StrPas(V.VPChar));
vtCurrency: Result := 'Unsupported TVarRec.VType = vtCurrency';
vtVariant: Result := 'Unsupported TVarRec.VType = vtVariant';
vtWideString: Result := 'Unsupported TVarRec.VType = vtWideString';
vtInterface: Result := 'Unsupported TVarRec.VType = vtInterface';
vtInt64: Result := _IntToStr(V.VInt64^);
{$IFDEF COMPILER12_UP}
vtUnicodeString: Result := PWideChar(V.VUnicodeString);
{$ENDIF}
else
Result := 'Unknown TVarRec.VType = "' + _IntToStr(Ord(V.VType)) + '" ';
end;
//OutputDebugString(PChar('VarRecToString ' + Result));
end;
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be