Optimize the code for reading UTF-8 files.