MOBILE-1915 automated and tagged.
Only define force_encoding if it doesn't exist, so that everything works on newer Ruby.
Automation and tagging for MOBILE-1903.
Add tests for MOBILE-1700.