Skip to content

Commit

Permalink
perf: 修复 mysql 中文输入问题
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeEirc committed Jan 22, 2024
1 parent 848b1b1 commit 7622c47
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/srvconn/conn_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ func (opt *sqlOption) Envs() []string {
}

envs := make([]string, 0, 6)
// 设置下系统环境的语言, 中文输入问题
envLang := os.Getenv("LANG")
if envLang == "" {
envLang = "zh_CN.UTF-8"
}
envs = append(envs, fmt.Sprintf("LANG=%s", envLang))
envs = append(envs, fmt.Sprintf("USERNAME=%s", opt.Username))
envs = append(envs, fmt.Sprintf("HOSTNAME=%s", opt.Host))
envs = append(envs, fmt.Sprintf("PORT=%d", opt.Port))
Expand Down

0 comments on commit 7622c47

Please sign in to comment.