elvish
elvish copied to clipboard
lackEOLRune cause garbled
elvish write '\u23ce' while doing setupVT.
const (
lackEOLRune = '\u23ce'
lackEOL = "\033[7m" + string(lackEOLRune) + "\033[m"
enableSGRMouse = false
)
s += fmt.Sprintf("\033[?7h%s%*s\r \r", lackEOL, width-wcwidth.OfRune(lackEOLRune), "")
This will cause garbled while terminal is set charset gbk. elvish shows:
~/Desktop/elvish-0.14.1>
鈴?
This will cause garbled while terminal is set charset gbk.
AFAIK, Elvish only supports (albeit implicitly) Unicode locales and the UTF-8 encoding for charsets. This is (sort of) documented at https://elv.sh/ref/language.html. It is a consequence of Elvish being implemented in a language that itself only treats Unicode as a first class charset.
P.S., Thanks for opening this issue. It caused me to read https://en.wikipedia.org/wiki/GBK_(character_encoding). Even though I'm a native English speaker I was aware of GB2312 but not the GBK charset.
@xiaq, This should be closed since I'm pretty certain Elvish will never have support for legacy, non-Unicode, charsets. The only thing we might want to do is issue a warning if the locale is not UTF-8.