deal with encoding properly