fix encoding of getfragments() results