From 3883d1cf85c2d987d9c94f000580974ef06536e0 Mon Sep 17 00:00:00 2001 From: k3b <1374583+k3b@users.noreply.github.com> Date: Tue, 14 May 2019 10:44:25 +0200 Subject: [PATCH] fixing #7: --- .gitignore | 1 + .../android/lossless_jpg_crop/CropAreasChooseActivity.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6139680..2ec2b00 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /.idea /cropper/build /todo.txt +/advertise-llCrop.md diff --git a/app/src/main/java/de/k3b/android/lossless_jpg_crop/CropAreasChooseActivity.java b/app/src/main/java/de/k3b/android/lossless_jpg_crop/CropAreasChooseActivity.java index 4e6b682..506e80c 100644 --- a/app/src/main/java/de/k3b/android/lossless_jpg_crop/CropAreasChooseActivity.java +++ b/app/src/main/java/de/k3b/android/lossless_jpg_crop/CropAreasChooseActivity.java @@ -259,9 +259,12 @@ private void onOpenPublicOutputUriPickerResult(int resultCode, Uri outUri) { private String toString(Uri outUri) { if (outUri == null) return ""; + // may crash with "IllegalCharsetNameException" in https://github.com/k3b/LosslessJpgCrop/issues/7 try { return URLDecoder.decode(outUri.toString(), StandardCharsets.UTF_8.toString()); - } catch (UnsupportedEncodingException e) { + } catch (Exception e) { + //!!! UnsupportedEncodingException, IllegalCharsetNameException + Log.e(TAG, "err cannot convert uri to string('" + outUri.toString() + "').", e); return outUri.toString(); } }