Specify encoding when working with strings

This fixes warnings reported by Findbugs in
http://ci.openmicroscopy.org/view/Failing/job/BIOFORMATS-5.1-merge-build/352