encode

fun encode(message: Gs1Message, enforceMaxDataCharacters: Boolean = true): Code128Symbol(source)

Encodes message, choosing Code Sets C and B to produce the shortest symbol.

Parameters

enforceMaxDataCharacters

reject messages with more than MAX_DATA_CHARACTERS data characters, as the GS1 General Specifications require. Split such data over two symbols.

Throws

with Gs1ErrorCode.GS1_128_TOO_LONG if the message is too long.