发短信中文乱码
当是cdma时,中文显示乱码为:“??????????”
if (isCDMA()) {
DatagramConnection dgConn = null;
try {
dgConn = (DatagramConnection) Connector.open("sms://" + number);
byte[] data = content.getBytes();
Datagram dg = dgConn.newDatagram(dgConn.getMaximumLength());
dg.setData(data, 0, data.length);
dgConn.send(dg);
Thread.sleep(SLEEP_SMS);
} catch (IOException e) {
System.out.println("sendSMS--->CDMA--->" + e.getMessage());
} catch (InterruptedException e) {
System.out.println("sleepInterrupted--->" + e.getMessage());
} finally {
if (dgConn != null)
try {
dgConn.close();
} catch (IOException e) {
System.out.println("sendSMS---finally--->" + e.getMessage());
}
}
}
[解决办法]
已经解决!