Fix encoding issue when creating archive

To support wider character range, there is a need to convert the unicode string to utf-8. Otherwise, the "os" library doesn't fail with UnicodeEncodeError.