libs/web: add UTF-8 validation and pcdata escaping C routines to template parser