def guess_type(self): # add UTF-8 by default to text content-types guess = PasteFileApp.guess_type(self) content_type = guess[0] if content_type and "text/" in content_type and "charset=" not in content_type: content_type += "; charset=UTF-8" return (content_type, guess[1])