Got rid of deprecated APIs
Fixed UTF-8 issue for file