vcard から文字列をデコードしようとしています
ADR;WORK;;ENCODING=QUOTED-PRINTABLE:;Building 723 Room 317;;Auckland;;Private Bag 92019 Auckland;New Zealand
Android ビューに表示する標準テキストに変換します。http://android-vcard.googlecode.com/hg/examples/ReadExample.javaの例を使用して、アドレス フィールドを vCard パーサーで既に解析しました。
ここでのデコードの提案に従いました:コーデックライブラリを使用します。ただし、文字列;Building 723 Room 317;;Auckland;;Private Bag 92019 Auckland;New Zealand
をデコードするのではなく、文字列を表示しています。
私のデコードコード:
byte[] byteAddress = address.getBytes();
String decodedAddress = "";
try {
decodedAddress = new String(QuotedPrintableCodec.decodeQuotedPrintable(byteAddress));
} catch (DecoderException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
TextView textView4 = (TextView) findViewById(R.id.address);
textView4.setText(decodedAddress);