Use feature detection for 1.9+ encoding support

The version-check for 1.9 didn't work on 2.0, so instead
of version checking, check for the method used.