*/
public static List<NameValuePair> parse(final String s, final Charset charset, final char... parameterSeparator) {
if (s == null) {
return Collections.emptyList();
}
final BasicHeaderValueParser parser = BasicHeaderValueParser.INSTANCE;
final CharArrayBuffer buffer = new CharArrayBuffer(s.length());
buffer.append(s);
final ParserCursor cursor = new ParserCursor(0, buffer.length());
final List<NameValuePair> list = new ArrayList<NameValuePair>();
while (!cursor.atEnd()) {
final NameValuePair nvp = parser.parseNameValuePair(buffer, cursor, parameterSeparator);
if (nvp.getName().length() > 0) {
list.add(new BasicNameValuePair(
decodeFormFields(nvp.getName(), charset),
decodeFormFields(nvp.getValue(), charset)));
}