mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-23 10:17:33 +01:00
don't write a trailing /u0000 if its the last char of the string
This commit is contained in:
parent
541301278b
commit
c5a8f0c8a5
@ -121,6 +121,11 @@ public final class ResXmlEncoders {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!isPrintableChar(c)) {
|
if (!isPrintableChar(c)) {
|
||||||
|
|
||||||
|
// lets not write trailing \u0000 if we are at end of string
|
||||||
|
if ((out.length() + 1) == str.length() && c == '\u0000') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
out.append(String.format("\\u%04x", (int) c));
|
out.append(String.format("\\u%04x", (int) c));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -132,7 +137,6 @@ public final class ResXmlEncoders {
|
|||||||
if (enclose || wasSpace) {
|
if (enclose || wasSpace) {
|
||||||
out.insert(startPos, '"').append('"');
|
out.insert(startPos, '"').append('"');
|
||||||
}
|
}
|
||||||
|
|
||||||
return out.toString();
|
return out.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user