[WIP]fix UnicodeDecodeError in debug templatetag

ticket: [23060](https://code.djangoproject.com/ticket/23060)

pls, review, thanks :beer: 
I don't think it's necessary to create new files for this test. We could use for example `django.contrib.auth.models.Group` for a simple model with a name, and the test could be appended to the `TemplateRegressionTests` class, for example.