Encode contents to latin1 before attaching to upload request

TWiki seems to expect this encoding and it prevents errors in
urlencode, which does not handle unicode data at all.