procedure THttpServer.IdHTTPServer1CommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo); AResponseInfo.ContentType := 'text/html; charset=gb2312'; //AResponseInfo.ContentEncoding := 'gb2312'; 此行似乎無效 必須在上行中寫才有效. //html中 //<meta http-equiv="content-type" content="text/html; charset=gb2312" /> //也比較晚,會先顯示亂碼,再刷新為正確 AResponseInfo.ContentType := 'text/script; charset=gb2312'; |
|