Added inDomain function to encoding interface