platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerNew.java in rhodes-3.3.5 vs platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerNew.java in rhodes-3.4.2
- old
+ new
@@ -172,10 +172,22 @@
}
// Check that there's actually something to send
if (message.length() > 0) {
// Get the message bytes and tell the BluetoothChatService to write
- byte[] send = message.getBytes(Charset.forName("UTF-8"));// getBytes();
+ byte[] send = null;
+ try {
+ Charset chset = Charset.forName("UTF-8");
+ if (chset != null) {
+ send = message.getBytes(chset);// getBytes();
+ }
+ else {
+ send = message.getBytes();
+ }
+ }
+ catch(Exception e) {
+ send = message.getBytes();
+ }
mSession.write(send);
}
}