[java] Encode String to UTF-8