Revert "Fix encode error when dealing with unicode filename."

This reverts commit 5a0ad05c4a652a62776c3bf9ba30c599f2c0f3d0.