guessing api charset if it is not given