fixes unicode conversion for user_agent (test unicode or str first)