Add code to handle ownCloud servers running on IDN - replacing PR#626 after solving conflicts