fix bug 1045303 - handle UTF-8 and control codes consistently
Merge pull request #2257 from rhelmer/bug1045303-hive-encoding-problem

fix bug 1045303 - handle UTF-8 and control codes consistently