changing default encodings to objects instead of strings