encode to utf-8
include <?xml header tag with encoding utf-8
use codecs to open the template file, default open is in utf-8 encoding