@ Nullable public static String encode ( @ Nullable final String sValue , @ Nonnull final Charset aCharset , final ECodec eCodec ) { if ( sValue == null ) return null ; try { switch ( eCodec ) { case Q : return new RFC1522QCodec ( aCharset ) . getEncoded ( sValue ) ; case B : default : return new RFC1522BCodec ( aCharset ) . getEncoded ( sValue ) ; } } catch ( final Exception ex ) { return sValue ; } }
Used to encode a string as specified by RFC 2047