encode static method

ResultList encode(
  1. String stringToEncode,
  2. Version? version,
  3. Encoding? priorityCharset,
  4. bool isGS1,
  5. ErrorCorrectionLevel ecLevel,
)

Encodes the string minimally

@param stringToEncode The string to encode @param version The preferred {@link Version}. A minimal version is computed (see {@link ResultList#getVersion method} when the value of the argument is null @param priorityCharset The preferred {@link Charset}. When the value of the argument is null, the algorithm chooses charsets that leads to a minimal representation. Otherwise the algorithm will use the priority charset to encode any character in the input that can be encoded by it if the charset is among the supported charsets. @param isGS1 {@code true} if a FNC1 is to be prepended; {@code false} otherwise @param ecLevel The error correction level. @return An instance of {@code ResultList} representing the minimal solution. @see ResultList#getBits @see ResultList#getVersion @see ResultList#getSize

Implementation

static ResultList encode(
  String stringToEncode,
  Version? version,
  Encoding? priorityCharset,
  bool isGS1,
  ErrorCorrectionLevel ecLevel,
) {
  return MinimalEncoder(stringToEncode, priorityCharset, isGS1, ecLevel)
      .doEncode(version);
}