[LOGMGR-104] Fix bad encoding algorithm.

The UTF encoding method was incorrect. Also a small change to stop using ```String.toCharArray()```.