Fix invalid encoding error handling for Ruby 1.9.3

Ruby 1.9.3 throws a different error when there is a problem with a
file's encoding. Handle this case manually.

Change-Id: I59c0b26ce51104c3f2a37f32017f0fca148769cc
Reviewed-on: https://gerrit.causes.com/32725
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>