fix encoding bug in codec

Link: https://github.com/GeneAssembly/biosal/issues/540
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>