package io.quarkus.runtime.configuration;

import static io.quarkus.runtime.configuration.ConverterSupport.DEFAULT_QUARKUS_CONVERTER_PRIORITY;

import java.io.Serializable;
import java.nio.charset.Charset;

import javax.annotation.Priority;

import org.eclipse.microprofile.config.spi.Converter;

/**
 * A converter which converts a Charset string into an instance of {@link java.nio.charset.Charset}.
 */
@Priority(DEFAULT_QUARKUS_CONVERTER_PRIORITY)
public class CharsetConverter implements Converter<Charset>, Serializable {

    private static final long serialVersionUID = 2320905063828247874L;

    @Override
    public Charset convert(String value) {
        try {
            return Charset.forName(value);
        } catch (Exception e) {
            throw new IllegalArgumentException("Unable to create Charset from: '" + value + "'", e);
        }
    }
}

@@ -647,24 +647,212 @@
 ng value) %7B%0A
+        if (value == null) %7B%0A            return null;%0A        %7D%0A%0A        String trimmedCharset = value.trim();%0A%0A        if (trimmedCharset.isEmpty()) %7B%0A            return null;%0A        %7D%0A%0A
         try 
@@ -888,21 +888,30 @@
 forName(
-value
+trimmedCharset
 );%0A     
@@ -1021,21 +1021,30 @@
 m: '%22 + 
-value
+trimmedCharset
  + %22'%22, 

Improve CharsetConverter to trim the value before conversion