mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-17 11:07:35 -05:00
Resolves #189 - add UTF-8 encoding to shoutcast v2 (ultravox) XML metadata update values.
This commit is contained in:
@@ -18,6 +18,9 @@
|
||||
******************************************************************************/
|
||||
package audio.broadcast.shoutcast.v2.ultravox;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
public enum UltravoxMetadata
|
||||
{
|
||||
ALBUM_TITLE("TALB"),
|
||||
@@ -58,11 +61,11 @@ public enum UltravoxMetadata
|
||||
* @param value to enclose in XML tags
|
||||
* @return xml tag wrapped value
|
||||
*/
|
||||
public String asXML(String value)
|
||||
public String asXML(String value) throws UnsupportedEncodingException
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("<").append(getXMLTag()).append(">");
|
||||
sb.append(value);
|
||||
sb.append(URLEncoder.encode(value, "UTF-8"));
|
||||
sb.append("</").append(getXMLTag()).append(">");
|
||||
|
||||
return sb.toString();
|
||||
|
||||
Reference in New Issue
Block a user