Fix: reset errors on each isValid() call
Refactor: set/get internal encoding