JC-1706 remake htmlEncode() in utils.js