CS-5870: Problem in ChatBar when user name contains capital letter

Fix description: add function encodeUserName to bypass the limitation of sensitive username of Openfire