changed encode from "strict" to "ignore"