diff options
Diffstat (limited to 'vdrmanager/src/de')
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java | 9 | ||||
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java | 12 |
2 files changed, 19 insertions, 2 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java index de45363..ec96eeb 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java @@ -148,6 +148,13 @@ public class Preferences { */ private int timeout; + private String encoding = "utf-8"; + + + public String getEncoding() { + return encoding; + } + public int getConnectionTimeout() { return connectionTimeout; } @@ -588,6 +595,8 @@ public class Preferences { prefs.streamingPassword = getString(context, R.string.streaming_password_key, ""); + prefs.encoding = getString(context, R.string.vdr_encoding_key, "utf-8"); + thePrefs = prefs; } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java index ce7d278..7423a26 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java @@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.io.UnsupportedEncodingException; import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketTimeoutException; @@ -280,8 +281,15 @@ public abstract class SvdrpClient<Result> { // remember char lineBytes.write(c); } - - return lineBytes.toString(); + + String line = null; + try{ + line = lineBytes.toString(Preferences.get().getEncoding()); + } catch(UnsupportedEncodingException usex){ + Log.w(TAG, usex); + line = lineBytes.toString(); + } + return line; } public void runCommand(final String command) throws SvdrpException { |