Fixed encoding problems X-File-Name header

When non-ascii chars are presents in file name, a TypeError exception is thrown.