TextOutputOptions.Encoding Property

Set the character encoding of the text.

Syntax

public string Encoding { get;  set; }

Remarks

The following are encodings recognized by HotDocs:

Encoding Comments
ANSI Not recommended because ANSI is not portable.
UTF-8  
UTF-16LE Little endian UTF-16.
UTF-16 Equivalent to UTF-16LE.
UTF-16BE Big endian UTF-16.
windows-1252 ANSI, but specifically the Windows 1252 code page.

By default, all of the above UTF encodings use a byte order mark. To avoid using a byte order mark, the text "-NOBOM" may be appended to the encoding name; e.g. UTF-16-NOBOM. Alternatively, to ensure that a byte order mark is always included, the text "-BOM" may be appended to the encoding. When converting from RTF or DOCX to text, the default encoding is UTF-16 with a byte order mark.

If no encoding is specified, the conversion of RTF or DOCX to text uses a little-endian, UTF-16 encoding with a byte order mark included. If no encoding is specified, and the input template is plain text (TTX), then the encoding of the TTX template is used. The encoding of the TTX template is determined from the byte order mark if there is one. If there is no byte order mark, the encoding is interpreted as ANSI.