Here you can find the source of encode(Properties prop)
static public String encode(Properties prop)
//package com.java2s; /*//from ww w.j a va 2 s.com * Flash and Java activities in Moodle * http://sourceforge.net/projects/flashjavamoodle/ * * Copyright (C) 2011 Departament d'Ensenyament de la Generalitat de Catalunya * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation. */ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Enumeration; import java.util.Properties; public class Main { static public String encode(Properties prop) { try { StringBuffer sb = new StringBuffer(); Enumeration e = prop.keys(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); String value = prop.getProperty(key); String ekey = URLEncoder.encode(key, "utf-8"); String evalue = URLEncoder.encode(value, "utf-8"); if (sb.length() > 0) sb.append("&"); sb.append(ekey); sb.append("="); sb.append(evalue); } return sb.toString(); } catch (UnsupportedEncodingException f) { throw new Error(f); } } }