code: public void setEncoding(String enc) {
          if (!ModbusUtil.isBlank(enc) &&
                  (enc.equalsIgnoreCase(Modbus.SERIAL_ENCODING_ASCII) || enc.equalsIgnoreCase(Modbus.SERIAL_ENCODING_RTU))) {
              encoding = enc;
          }
          else {
              encoding = Modbus.DEFAULT_SERIAL_ENCODING;
          }
      }
docs: Sets the encoding to be used.
  
  @param enc the encoding as string.
  @see Modbus#SERIAL_ENCODING_ASCII
  @see Modbus#SERIAL_ENCODING_RTU