Possible fix for issues #1016, #993, and #1024 - Unicode decode/encode issues