fix UnicodeDecodeError with unicode userid and non-ascii in QUERY_STRING