나는 SMS 메시지를 읽고 Google 애플 리케이션 엔진 서버로 보내는 안드로이드 애플리케이션이있다. 일부 사용자는 특정 언어가 제대로 전달되지 않는다고 불평하고 있습니다.자바와 파이썬의 유니 코드 문자열 지원
// 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());
}
메시지 변수에 다른 언어의 SMS 메시지가 포함되어 있습니다. 어떻게 지원하나요? 또한, 그것을 내 서버 (파이썬)로 보내야하며, 어떻게하면 유니 코드를 서버에서 번역 할 수 있습니까?
파이썬은 유니 코드와 잘 호환됩니다. 다음은 포괄적 인 기사입니다. http://docs.python.org/2/howto/unicode.html – jyore