Make unsuported charsets explicit, add freeutils charsets

pull/50/head
M66B 6 years ago
parent e9b7458a70
commit 65cd93a340

@ -99,6 +99,7 @@ FairEmail uses:
* [JavaMail](https://javaee.github.io/javamail/). Copyright (c) 1997-2018 Oracle® and/or its affiliates. All rights reserved. [GPLv2+CE license](https://javaee.github.io/javamail/JavaMail-License).
* [jsoup](https://jsoup.org/). Copyright © 2009 - 2017 Jonathan Hedley. [MIT license](https://jsoup.org/license).
* [JCharset](http://www.freeutils.net/source/jcharset/). Copyright © 2005-2015 Amichai Rothman. [GNU General Public License](http://www.freeutils.net/source/jcharset/#license)
* [Android Support Library](https://developer.android.com/tools/support-library/). Copyright (C) 2011 The Android Open Source Project. [Apache license](https://android.googlesource.com/platform/frameworks/support/+/master/LICENSE.txt).
* [Android Architecture Components](https://developer.android.com/topic/libraries/architecture/). Copyright 2018 The Android Open Source Project, Inc. [Apache license](https://github.com/googlesamples/android-architecture-components/blob/master/LICENSE).

@ -74,4 +74,6 @@ dependencies {
// https://jsoup.org/
implementation "org.jsoup:jsoup:$jsoup_version"
// http://www.freeutils.net/source/jcharset/
implementation "net.freeutils:jcharset:2.0"
}

@ -253,9 +253,9 @@ public class MessageHelper {
try {
s = part.getContent().toString();
} catch (UnsupportedEncodingException ex) {
Log.w(Helper.TAG, part.getContentType() + "\n" + ex + "\n" + Log.getStackTraceString(ex));
s = "Unsupported encoding: " + part.getContentType() + "\n\n";
throw new UnsupportedEncodingException(part.getContentType());
/*
// https://javaee.github.io/javamail/FAQ#unsupen
InputStream is = part.getInputStream();
ByteArrayOutputStream os = new ByteArrayOutputStream();
@ -269,6 +269,7 @@ public class MessageHelper {
} catch (UnsupportedEncodingException uex) {
Log.w(Helper.TAG, uex + "\n" + Log.getStackTraceString(uex));
}
*/
}
if (part.isMimeType("text/plain"))

Loading…
Cancel
Save