Table of Contents

Class Gs1HandlingConverter

Namespace
ScanbotSDK.MAUI.Barcode
Assembly
ScanbotSDK.Shared.dll

GS1 message handling options. The GS1 standard defines a key-value format for business-centric data that can be encoded into many 1D and 2D barcode types. https://ref.gs1.org/standards/genspecs/

GS1 messages have two representations or formats: a human-readable format and a machine-readable format. The human-readable format uses parentheses to wrap the keys in each pair. For example, the string "(01)012345678901(37)02(3922)00278" contains three AI keys: 01, 37, and 3922. The corresponding values are 012345678901, 02, and 00278.

The machine-readable format uses the special ASCII \x1D character to terminate key-value pairs in the string in cases where the given key implies that the value is variable-length. The equivalent machine-readable string for the above example is "010123456789013702\x1D392200278". In the above example, the 01 AI key is fixed-length, so the \x1D character is not necessary. The 37 AI keys is variable-length, so the \x1D character is necessary after the value in the pair. The 3922 AI key is also variable-length, but it is the last pair in the message, so the \x1D character is not necessary at the end.

The character \x1D is UNPRINTABLE - this means that if you try to print or otherwise visualize a GS1 message containing the \x1D character, you may see a number of different results, depending on how the system handles unprintable characters. You may see a question mark, a box, an escape sequence, a space or nothing at all.

public class Gs1HandlingConverter : JsonConverter<Gs1Handling>
Inheritance
Gs1HandlingConverter
Inherited Members

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type Gs1Handling.

public override Gs1Handling Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader

The reader.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

An object that specifies serialization options to use.

Returns

Gs1Handling

The converted value.

Write(Utf8JsonWriter, Gs1Handling, JsonSerializerOptions)

Writes a specified value as JSON.

public override void Write(Utf8JsonWriter writer, Gs1Handling color, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter

The writer to write to.

color Gs1Handling
options JsonSerializerOptions

An object that specifies serialization options to use.