TsgcHTTPServer › Proprietà › Charset

Charset Proprietà

Charset applicato all'intestazione Content-Type delle risposte servite automaticamente da DocumentRoot.

Sintassi

property Charset: string read FCharset write FCharset;

Valore predefinito

(stringa vuota)

Note

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.

Esempio


oServer := TsgcHTTPServer.Create(nil);
oServer.DocumentRoot := 'c:\www\files';
oServer.Charset := 'utf-8';
oServer.Active := true;

Torna alle Proprietà