closes issue #8, missing locale defaults to ascii

if the return value of locale.getpreferredencoding() is empty or results
in a string that is not a valid codec (raises LookupError), then set the
keyboard _encoding to 'ascii'.