How can we retrieve actual unicode string from the content fields of TWebRequest. When i try to read content fields of TWebRequest to get the input unicode value i have entered in a text i see scrambled value instead of the actual. The input which i gave was Добро but in the content fields i see the value Добро. The Response contenttype is set to text/html and charset='UTF-8'. Can any body tell why doesn't it show the actual value entered in the text box and how this can be corrected.
sample code which i was testing
procedure TWebModule1.WebModule1HelloAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
s : string;
PageProducer1 : TPageProducer;
begin
Response.ContentType := 'text/html;charset=UTF-8';
s := Request.ContentFields.Text;
PageProducer1 := TPageProducer.Create(nil);
try
PageProducer1.HTMLFile := 'C:\Hello.tmpl';
PageProducer1.OnHTMLTag := PageProducer1HTMLTag;
Response.Content := PageProducer1.Content + ' ' + 'Entered string:' + s;
finally
PageProducer1.Free;
end;
end;
Hello.tmpl just has text box and submit button