Skip to content

Commit

Permalink
fixing #7:
Browse files Browse the repository at this point in the history
  • Loading branch information
k3b committed May 14, 2019
1 parent a067271 commit 3883d1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
/.idea
/cropper/build
/todo.txt
/advertise-llCrop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 3883d1c

Please sign in to comment.