fixed bug when js file contains non-ascii characters