TsgcHTTPServer › Proprietà › Charset
Charset applicato all'intestazione Content-Type delle risposte servite automaticamente da DocumentRoot.
property Charset: string read FCharset write FCharset;
(stringa vuota)
Charset viene passato alla risposta Indy sottostante come AResponseInfo.Charset ogni volta che un file viene servito automaticamente da DocumentRoot, in modo che i browser sappiano come decodificare i byte del file (ad esempio utf-8 o iso-8859-1). Non ha alcun effetto sulle risposte costruite direttamente all'interno di OnCommandGet / OnCommandOther — per queste impostare AResponseInfo.Charset direttamente nel gestore. Lasciare Charset vuoto per utilizzare il valore predefinito di Indy.
oServer := TsgcHTTPServer.Create(nil);
oServer.DocumentRoot := 'c:\www\files';
oServer.Charset := 'utf-8';
oServer.Active := true;