From eaa08bada45811abd6a86d710941dbe59c43db49 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 7 May 2014 00:22:32 -0400 Subject: [PATCH] Convert byte[] to char[] manually since IBM437 isn't available on some platforms --- .../src/com/limelight/nvstream/rtsp/SdpGenerator.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java b/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java index df463e76..52bb9075 100644 --- a/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java +++ b/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java @@ -1,6 +1,5 @@ package com.limelight.nvstream.rtsp; -import java.io.UnsupportedEncodingException; import java.net.InetAddress; import java.net.Inet6Address; import java.nio.ByteBuffer; @@ -11,9 +10,13 @@ import com.limelight.nvstream.StreamConfiguration; public class SdpGenerator { private static void addSessionAttributeBytes(StringBuilder config, String attribute, byte[] value) { - try { - addSessionAttribute(config, attribute, new String(value, "IBM437")); - } catch (UnsupportedEncodingException e) {} + char str[] = new char[value.length]; + + for (int i = 0; i < value.length; i++) { + str[i] = (char)value[i]; + } + + addSessionAttribute(config, attribute, new String(str)); } private static void addSessionAttributeInts(StringBuilder config, String attribute, int[] value) {