Skip to content

Commit d615e68

Browse files
authored
don't filter unicode characters from fonts in the browser (microsoft#10439)
1 parent 12e2d32 commit d615e68

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pxtcompiler/emitter/emitter.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,13 +2717,18 @@ ${lbl}: .short 0xffff
27172717
let mask = bin.usedChars
27182718
let buf = ""
27192719
let incl = ""
2720-
for (let pos = 0; pos < data.length; pos += chsz) {
2721-
let charcode = data.charCodeAt(pos) + (data.charCodeAt(pos + 1) << 8)
2722-
if (charcode < 128 || (mask[charcode >> 5] & (1 << (charcode & 31)))) {
2723-
buf += data.slice(pos, pos + chsz)
2724-
incl += charcode + ", "
2720+
if (opts.target.isNative) {
2721+
for (let pos = 0; pos < data.length; pos += chsz) {
2722+
let charcode = data.charCodeAt(pos) + (data.charCodeAt(pos + 1) << 8)
2723+
if (charcode < 128 || (mask[charcode >> 5] & (1 << (charcode & 31)))) {
2724+
buf += data.slice(pos, pos + chsz)
2725+
incl += charcode + ", "
2726+
}
27252727
}
27262728
}
2729+
else {
2730+
buf = data;
2731+
}
27272732
s = U.toHex(U.stringToUint8Array(buf))
27282733
}
27292734
} else if (!thisJres.dataEncoding || thisJres.dataEncoding == "base64") {

0 commit comments

Comments
 (0)