code: public static ByteArrayContent fromString(String type, String contentString) {
      return new ByteArrayContent(type, StringUtils.getBytesUtf8(contentString));
    }
docs: Returns a new instance with the UTF-8 encoding (using {@link StringUtils#getBytesUtf8(String)})
  of the given content string.
  
  <p>Sample use:
  
  <pre>
  <code>
  static void setJsonContent(HttpRequest request, String json) {
  request.setContent(ByteArrayContent.fromString("application/json", json));
  }
  </code>
  </pre>
  
  @param type content type or {@code null} for none
  @param contentString content string
  @since 1.5