added a test, and encoding to source file