Browse Source

Make unsuported charsets explicit, add freeutils charsets

main
M66B 6 years ago
parent
commit
65cd93a340
4 changed files with 7 additions and 3 deletions
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. +1
    -0
      README.md
  3. +2
    -0
      app/build.gradle
  4. +4
    -3
      app/src/main/java/eu/faircode/email/MessageHelper.java

BIN
.idea/caches/build_file_checksums.ser View File


+ 1
- 0
README.md View File

@ -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).


+ 2
- 0
app/build.gradle View File

@ -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"
}

+ 4
- 3
app/src/main/java/eu/faircode/email/MessageHelper.java View File

@ -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