add test script for -M
Fixes #45. If no encoding type was not specified for one line messages, it was NULL and a debug message tried to print it causing seg fault