-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendering Issues with zh_CN.UTF-8 #40
Comments
Hi! I’m not able to reproduce this on any of my Macs. I suspect your terminal may not be using UTF-8 (see #30). Would you mind running the Also, to be thorough, what terminal emulator and font are you using? It appears to be Lucida Console in macOS stock terminal, though it would be good to verify this. |
╰─$ locale
LANG="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_CTYPE="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_ALL= |
my terminal is iTerm2, and the font I use is |
I solved this issue based on this answer, |
Okay, that’s good to know. Still, it would be good to figure out why things aren’t rendering properly under |
Ok, I'll leave that question open |
Thanks! Related: mattn/go-runewidth#14 |
Also for reference: setting |
This also works. When I set |
|
@meowgorithm os.Setenv("RUNEWIDTH_EASTASIAN", "true")
os.Setenv("LC_CTYPE", "en_US.UTF-8") before executing the main app, but that didn't work, any nice solution? |
@Qrnbth have you tried |
This comment was marked as off-topic.
This comment was marked as off-topic.
Encodings like this are very difficult to deal with because there's technically no correct answer to how something should be configured. For such a common failure as this, it makes sense to include a link in the Now that this is known, it may also be worth while to pre-emptively check the value of that environment variable and see if there's a way to provide a warning to the user. This isn't much different to other tools that, as an example, require a nerd font, in order to correctly display various icons and such. |
In the source code of According to the execution order of Just ensure that the package conf
import (
"os"
)
func init() {
os.Setenv("RUNEWIDTH_EASTASIAN", "0")
} package main
import (
_ "project/conf"
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/glamour"
"github.com/charmbracelet/lipgloss"
) |
This do works,thanks |
Hello, when I run the example on mac, the typesetting is out of order, what's the matter?
The text was updated successfully, but these errors were encountered: