Updated CMS support for unicode.
minor optimization avoiding to create temporary string that might be big