Referring to this answer 2, how could I create an encoder to allow/ not encode the + character in a string?
For background, this is for a phone number field of type string where numbers can be specified in an international format. This phone number field is part of a request that is serialized into a Json body and used to call a thirdparty API which checks the phone number.
Currently using the default Encoder changes any + into \u002B
JsonSerializerOptions options = new JsonSerializerOptions
{
Encoder = ...
};
Edit: Wondering if 'UnsafeRelaxedJsonEscaping' is the way to go here, or if there is a more narrow option, for example using 'JavaScriptEncoder.Create(..)' or something else.