Skip to content

Commit

Permalink
Add support for Android 14
Browse files Browse the repository at this point in the history
possibly lower versions
  • Loading branch information
3c71 authored Mar 4, 2020
1 parent 89f4285 commit 8e34436
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,20 @@ public static Element createElement(QName key) {
public static Element createElement(Element parent, QName key) {
return parent.getOwnerDocument().createElementNS(key.getNamespaceURI(), key.getPrefix() + ":" + key.getLocalPart());
}

/**
* @return standard UTF8 charset on any version of Android
*/
public static Charset standardUTF8()
{
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT)
{
return StandardCharsets.UTF_8;
}
else
{
//noinspection CharsetObjectCanBeUsed
return Charset.forName("UTF-8");
}
}
}

0 comments on commit 8e34436

Please sign in to comment.