shell commands encoding fix

Fix for #329.