Also let's pick this out into a `get_encoded_filename` function or similar, and include a link to the relevant part of the RFC.