1
0
Fork 0

Fix using default encoding

This commit is contained in:
Petri Hintukainen 2019-01-25 10:15:26 +02:00 committed by hpi1
parent e995610883
commit 0f26e1e032
2 changed files with 15 additions and 5 deletions

View File

@ -238,9 +238,14 @@ public class Libbluray {
}
byte[] type = getAacsData(4096);
String pkg = type != null ? new String(type) : null;
if (pkg != null) {
System.out.println("using " + pkg);
String pkg;
try {
pkg = type != null ? new String(type, "UTF-8") : null;
if (pkg != null) {
System.out.println("using " + pkg);
}
} catch (java.io.UnsupportedEncodingException uee) {
pkg = null;
}
System.setProperty("mhp.profile.enhanced_broadcast", "YES");

View File

@ -71,8 +71,13 @@ public class Adapter extends LoaderAdapter implements BDJClassLoaderAdapter {
final String s2 = "org/videolan/mmbd/Adapter$If";
Map m = new HashMap();
String d1, d2;
m.put(s1, d1 = (new String(b0) + new String(b1)));
m.put(s2, d2 = (new String(b0) + new String(b2)));
try {
m.put(s1, d1 = (new String(b0, "UTF-8") + new String(b1, "UTF-8")));
m.put(s2, d2 = (new String(b0, "UTF-8") + new String(b2, "UTF-8")));
} catch (java.io.UnsupportedEncodingException uee) {
throw new ClassNotFoundException();
}
BDJClassFileTransformer t = new BDJClassFileTransformer();
byte[] c1 = t.rename(loadBootClassCode(s1), m);