public static List<NameValuePair> parse (final String s, final Charset charset) {
        if (s == null) {
            return Collections.emptyList();
        }
        BasicHeaderValueParser deserializer = BasicHeaderValueParser.DEFAULT;
        CharArrayBuffer buffer = new CharArrayBuffer(s.length());
        buffer.append(s);
        ParserCursor cursor = new ParserCursor(0, buffer.length());
        List<NameValuePair> list = new ArrayList<NameValuePair>();
        while (!cursor.atEnd()) {
            NameValuePair nvp = deserializer.parseNameValuePair(buffer, cursor, DELIM);
            if (nvp.getName().length() > 0) {
                list.add(new BasicNameValuePair(
                        decodeFormFields(nvp.getName(), charset),
                        decodeFormFields(nvp.getValue(), charset)));
            }
        }
        return list;
    }
public static List < NameValuePair > parse ( final String s , final Charset charset ) { if ( s == null ) { return Collections . emptyList ( ) ; } BasicHeaderValueParser deserializer = BasicHeaderValueParser . DEFAULT ; CharArrayBuffer buffer = new CharArrayBuffer ( s . length ( ) ) ; buffer . append ( s ) ; ParserCursor cursor = new ParserCursor ( 0 , buffer . length ( ) ) ; List < NameValuePair > list = new ArrayList < NameValuePair > ( ) ; while ( ! cursor . atEnd ( ) ) { NameValuePair nvp = deserializer . parseNameValuePair ( buffer , cursor , DELIM ) ; if ( nvp . getName ( ) . length ( ) > 0 ) { list . add ( new BasicNameValuePair ( decodeFormFields ( nvp . getName ( ) , charset ) , decodeFormFields ( nvp . getValue ( ) , charset ) ) ) ; } } return list ; }
Returns a list of {@link NameValuePair NameValuePairs} as deserialized from the given string
using the given character encoding.

@param s
text to parse.
@param charset
Encoding to use when decoding the parameters.

@since 4.2