code: public void setCharset(String charsetName) {
          if (StringUtils.isEmpty(charsetName)) {
              setCharsetImpl(null);
              return;
          }
  
          Charset newCharset = null;
          try {
              newCharset = Charset.forName(charsetName);
              if (newCharset != charset) {
                  setCharsetImpl(newCharset);
              }
          } catch (IllegalCharsetNameException | UnsupportedCharsetException e) {
              log.error("Failed to set charset: " + charsetName, e);
          }
      }
docs: Sets the charset used for {@code String} related operations, for example, {@link #append(String)},
  {@link #setBody(String)}, or {@link #toString()}.
  <p>
  The charset is reset if {@code null} or empty (that is, it will use default charset or the charset determined internally
  by {@code HttpBody} implementations). The charset is ignored if not valid (either the name is not valid or is
  unsupported).
  <p>
  
  @param charsetName the name of the charset to set
  @see #getCharset()
  @see #DEFAULT_CHARSET