servicetalk-http-api/src/main/java/io/servicetalk/http/api/HttpSerializers.java
/**
     * Creates an {@link HttpSerializerDeserializer} that can serialize {@link String}s with
     * a {@link Charset}.
     *
     * @param charset The {@link Charset} to use for encoding.
     * @return {@link HttpSerializerDeserializer} that can serialize {@link String}s.
     */
Creates an  HttpSerializerDeserializer that can serialize  Strings with
a  Charset.

@param charset The  Charset to use for encoding.
@return  HttpSerializerDeserializer that can serialize  Strings.
Creates an HttpSerializerDeserializer that can serialize Strings with a Charset . @param charset The Charset to use for encoding . @return HttpSerializerDeserializer that can serialize Strings .
public static HttpSerializerDeserializer<String> textSerializer(Charset charset) {
        if (UTF_8.equals(charset)) {
            return TEXT_UTF_8;
        } else if (US_ASCII.equals(charset)) {
            return TEXT_ASCII;
        }
        final CharSequence contentType = newAsciiString("text/plain; charset=" + charset.name());
        return new DefaultHttpSerializerDeserializer<>(stringSerializer(charset),
                headers -> headers.set(CONTENT_TYPE, contentType),
                headers -> hasContentType(headers, TEXT_PLAIN, charset));
    }
public static HttpSerializerDeserializer < String > textSerializer ( Charset charset ) { if ( UTF_8 . equals ( charset ) ) { return TEXT_UTF_8 ; } else if ( US_ASCII . equals ( charset ) ) { return TEXT_ASCII ; } final CharSequence contentType = newAsciiString ( "text/plain; charset=" + charset . name ( ) ) ; return new DefaultHttpSerializerDeserializer < > ( stringSerializer ( charset ) , headers -> headers . set ( CONTENT_TYPE , contentType ) , headers -> hasContentType ( headers , TEXT_PLAIN , charset ) ) ; }
Creates an {@link HttpSerializerDeserializer} that can serialize {@link String}s with
 a {@link Charset}.
Creates an { @link HttpSerializerDeserializer } that can serialize { @link String } s with a { @link Charset } .