we can't patch String.force_encoding in 1.8 as Rails looks at that for some other issues. so... inline the checks