encoding determination fix