anchor.diff:      throw({error,invalid_encoding, Encoding});
   form_urlencode(Cs, _) ->
       throw({error,invalid_input, Cs}).
  -
  -
  -%% For each character in the entry's name and value that cannot be expressed using
  -%% the selected character encoding, replace the character by a string consisting of
  -%% a U+0026 AMPERSAND character (&), a "#" (U+0023) character, one or more ASCII
  -%% digits representing the Unicode code point of the character in base ten, and
  -%% finally a ";" (U+003B) character.
  -base10_encode(Cs) ->
  -    base10_encode(Cs, <<>>).
  -%%
  -base10_encode(<<>>, Acc) ->
  -    Acc;
  -base10_encode(<<H/utf8,T/binary>>, Acc) when H > 255 ->
  -    Base10 = convert_to_binary(integer_to_list(H,10), utf8, utf8),
  -    base10_encode(T, <<Acc/binary,"&#",Base10/binary,$;>>);
  -base10_encode(<<H/utf8,T/binary>>, Acc) ->
  -    base10_encode(T, <<Acc/binary,H>>).
  -
   
   html5_byte_encode(B) ->
       html5_byte_encode(B, <<>>).
  
positive.code:            ((X) >= 10) andalso ((X) =< 15) -> (X) + $A - 10
          end).
  
  -define(BAGGAGE_KEY, '$__otel_baggage_ctx_key').
  -define(BAGGAGE_HEADER, <<"baggage">>).
  
  -spec set(#{key() => value()} | [{key(), value()}]) -> otel_ctx:t().
  set(KeyValues) when is_list(KeyValues) ->
      set(maps:from_list(KeyValues));
  set(KeyValues) when is_map(KeyValues) ->
  
negative.code:     form_urlencode(Value, [{encoding, utf8}]).
  
  decode_key(Key) ->
      percent_decode(string:trim(unicode:characters_to_binary(Key))).
  
  decode_value(Value) ->
      percent_decode(string:trim(unicode:characters_to_binary(Value))).
  
  %% TODO: call `uri_string:percent_decode' and remove this when OTP-23 is
  %% the oldest version we maintain support for
  -spec percent_decode(URI) -> Result when
        URI :: uri_string:uri_string(),
        Result :: uri_string:uri_string() |
                  {error, {invalid, {atom(), {term(), term()}}}}.
  percent_decode(URI) when is_list(URI) orelse
                           is_binary(URI) ->
      raw_decode(URI).
  
  %% TODO: call `uri_string:percent_encode' when it is added to OTP and
  %% available in the oldest version we support
  form_urlencode(Cs, [{encoding, Encoding}])
    when is_list(Cs), Encoding =:= utf8; Encoding =:= unicode ->
      B = convert_to_binary(Cs, utf8, Encoding),
  