Added UTF handling for document files