add utf8 encoding to queried data when making category tree

This was causing the category names not loading into the document repository. Only ... was loading for each category and files were not loading at all. Also fixes char encoding so that diamond ? aren't showing