Allow custom encoding
Add stop test