prevent crash due to UnicodeDecodeError in the TemplatePanel

Hi, please accept my pull request - this hotfix prevent crash when TemplatePanel used on windows cyrillic locale. In fact, this is a bug in PrettyPrint/Python 2, and it will be not relevant in Python 3.
Tnx.