Handle blanks in encoder name

It's necessary to clean the field name before using it - it might have spaces or other illegal characters.