file and db encoding