force proper encoding of strings for API users