added utf encoding and different string conversion method for file content output