There may be a time when you need to use Extended ASCII Codes in your CodeSmith templates. If you have already tried using them into your template you have more than likely ran into the following problem. When a user first creates a template an Encoding attribute is not added by default to the CodeTemplate directive. So when a user starts adding characters in the Extended ASCII range, they will run into the following problem without first setting the encoding attribute. Below is an example of using Extended ASCII characters in a template.
If you don't add the Encoding Attribute to your template before saving, closing and reopening your template. You will be greeted by something like this.
The solution to this problem is to add an Encoding attribute to the CodeTemplate directive before saving.
<%@ CodeTemplate Language="C#" TargetLanguage="C#" Encoding="UTF-8" %>