Skip to content

Commit 23c5fa4

Browse files
Dump UI as UTF-16 for emojis
1 parent f9bc7ff commit 23c5fa4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

app/src/main/java/com/termux/api/apis/AccessibilityAPI.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ private static String dump() throws TransformerException, ParserConfigurationExc
116116
Transformer transformer = transformerFactory.newTransformer();
117117
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
118118
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
119+
// Necessary to not have surrogate pairs for emojis, see [Benjamin_Loison/Voice_assistant/issues/83#issue-3661619](https://codeberg.org/Benjamin_Loison/Voice_assistant/issues/83#issue-3661619)
120+
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-16");
119121
DOMSource source = new DOMSource(document);
120122

121123
StringWriter sw = new StringWriter();

0 commit comments

Comments
 (0)