我有一个 Android 应用程序,我在其中读取短信并将其发送到谷歌应用引擎服务器。一些用户抱怨某些语言无法正常通过。
// Execute query
cursor = context.getContentResolver().query(
SMS_PROVIDER_URI,
SMS_QUERY_FIELDS,
"date >= " + startDate.getTime(), // selection - get messages > startDate
null, // selectionArgs
"date ASC"); // order - get oldest messages first
// Iterate results
if (cursor != null && cursor.moveToFirst()) {
// read through all the sms and create a list
do {
String sender = cursor.getString(0);
String message = cursor.getString(2);
boolean isIncomingMessage = cursor.getString(3).contains("1");
Date date = new Date(cursor.getLong(1));
String contactName = ContactLookup.lookup(context, sender);
smsList.add(new SMSMessageInfo(sender, contactName,
message, isIncomingMessage, date));
} while (cursor.moveToNext());
}
message 变量包含来自不同语言的短信。我如何支持它?另外,我需要将它发送到我的服务器(python),如何翻译服务器上的 unicode?