Added fix for dealing with UTF-* data in text of template