问题
I have a string, which should be a stmp server in a later step for python.
The string is (little anonymized):
outlook-stg.d-a-tf.de/mapi/emsmdb/?MailboxId=cf27be4f-8605-40e4-94ab-d8cea3cc03bc@test.com
For sure the error is:
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
Which I understand is a problem with the name how I want to adress the server: label empty or too long - python urllib2
But how can I convert it in the right format? I also tried: Encoding with 'idna' codec failed in RethinkDB
With this code: .encode("idna")
but this also is the same error.
来源:https://stackoverflow.com/questions/59155219/how-can-i-convert-a-string-to-the-idna-coded-encoding-with-idna-coded-failed