Unicode: Properly handle multi-byte emoji with hyperblocks

snap7
Michael Ball 2021-12-11 14:37:33 -08:00
rodzic 5af67eae8b
commit b9c7198a77
1 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -4344,15 +4344,16 @@ Process.prototype.reportStringSize = function (data) {
};
Process.prototype.reportUnicode = function (string) {
var str;
var str, unicodeList;
if (this.enableHyperOps) {
if (string instanceof List) {
return string.map(each => this.reportUnicode(each));
}
str = isNil(string) ? '\u0000' : string.toString();
if (str.length > 1) {
return this.reportUnicode(new List(Array.from(str)));
unicodeList = Array.from(str);
if (unicodeList.length > 1) {
return this.reportUnicode(new List(unicodeList));
}
} else {
str = isNil(string) ? '\u0000' : string.toString();