Commit 1998645f authored by Will Hilton's avatar Will Hilton

Fix text-mode example for weird unicode like «ταБЬℓσ»

parent 59ea8ad7
......@@ -168,10 +168,13 @@ if (o.OpenMP.id === 0) {
if (c !== undefined) chars.push(c)
if (c instanceof Error) break
}
text = String.fromCharCode.apply(null, chars)
text = new TextDecoder().decode(new Uint8Array(chars))
}
```
...OK you're right, that is totally too hard. Idea: make a through stream that
consumes UTF-8 bytes and emits JavaScript's UTF-16 string characters.
### stdin : pull-stream Source
My plan is to take the `getchar()` function and wrap it into a [`pull-stream`](https://github.com/pull-stream/pull-stream),
......
......@@ -9,6 +9,6 @@ function (o) {
if (c !== undefined) chars.push(c)
if (c instanceof Error) break
}
o.modules.print(String.fromCharCode.apply(null, chars))
o.modules.print(new TextDecoder().decode(new Uint8Array(chars)))
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment