How to preserve UTF8 string from app to webserver in Python
\xfe is ISO-8859-1 encoding for þ.
While utf8 in content is widely supported, HTTP headers should be ASCII. The HTTP spec allows ISO-8859-1, but it's not recommended or reliable in tooling. Other encodings are not allowed without special escaping.
If possible, escape your special chars in a way that allows them to be transferred as ASCII. Base64 as suggested by fileoffset is one option, another would be the quote function from urllib.parse (or urrlib on python2)
I have an app that submit a request to a Python webserver. The app has a UTF8 string with the following contents:

la langue franþaise.ppt

This is put into a HTTP header, and somehow converted as such:

la langue fran\xfeaise.ppt

Then Python on the web-server tried to do something with the string that maybe expects it to be UTF8, and I get this error:

UnicodeDecodeError: 'utf8' codec can't decode byte 0xfe in position 14: invalid start byte

I would basically like to preserve this UTF8 from the app to the web-server, such that the variable would contain the following if I printed it:

la langue franþaise.ppt

What's the best way to preserve a UTF8 string from a web client and server (assuming both written in Python)?