core.actions: Avoid UnicodeDecodeError, fixes #172

Thanks to cym13 and GermainZ for looking into this