fixed platform dependent source encoding
(cherry picked from commit 9810cfe)