encode with explicit type uses type token