[1.7.x] Fixed #23593 -- Fixed crash in AdminEmailHandler with non-ASCII characters in request.

Thanks edevil for the report and Simon Charette for review.

Backport of 9dff5ce7c7 from master