about summary refs log tree commit diff stats
path: root/src/render
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-05-19 01:50:17 +0200
committerbptato <nincsnevem662@gmail.com>2023-05-19 01:50:17 +0200
commit26e8968a6499742cf37e00292a7d1c8ed620cad5 (patch)
treea3922f02f09b5c025dddcfe0e7a3a719c47ba4da /src/render
parentdac6a09c14b258ed725dcb265305a6445edc02ad (diff)
downloadchawan-26e8968a6499742cf37e00292a7d1c8ed620cad5.tar.gz
Add display/output encoding
Some encodings are still missing
Diffstat (limited to 'src/render')
-rw-r--r--src/render/rendertext.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/render/rendertext.nim b/src/render/rendertext.nim
index d0576c75..ed79d60f 100644
--- a/src/render/rendertext.nim
+++ b/src/render/rendertext.nim
@@ -21,6 +21,8 @@ proc newStreamRenderer*(stream: Stream, charsets: seq[Charset]): StreamRenderer
   result.ansiparser.state = PARSE_DONE
   for i in countdown(charsets.high, 0):
     result.charsets.add(charsets[i])
+  if charsets.len == 0:
+    result.charsets = @[DefaultCharset]
   let cs = result.charsets.pop()
   let em = if charsets.len > 0:
     DECODER_ERROR_MODE_FATAL