Response SetCharEncoding Method C# API
Sets the character encoding that is used to decode the data contained in this Response.

Namespace: Facilita.Web
Assembly: clrWebBrowser (in clrWebBrowser.dll) Version: (

public void SetCharEncoding(
	string charEncoding


Type: System String
The character encoding that should be used to decode the data in this Response.

Usually, the character encoding will be determined automatically by:
  • looking for a charset in the response headers (e.g. Content-Type: text/html; charset=utf-8)
  • looking for a meta-tag in the HTML (e.g. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  • looking for a Byte Order Mark at the beginning of the response data
  • defaulting to ISO-8859-1 (latin-1) if none of the above could be found

Therefore, it is not usually necessary to call this method explicitly. However, if some of the information above is incorrect/missing, then you can override the encoding by calling this method.


The following example demonstrates setting the character encoding.
Response response = request.Send(); 

// Use the utf-8 character set to interpret the data in this response

// The utf-8 character set will be used to decode the HTML and determine what the title is 
response.VerifyTitle("我是中国人", ActionType.ACT_NEXT_ITERATION);
See Also