Daniel YC Lin
Daniel YC Lin

Reputation: 16002

what's your utf-8 console setting when programming Google Go under Windows

We know google's Go default is UTF-8. I found in my Windows XP. It can not display correct about the UTF-8. The following code display in wrong.

package main

func main() {
  println("中文")
}

I've googled. It said use another font + reg + chcp 65001. But, I failed.

I've tried cmd and powershell v1 (it is the only provide version under XP). Both can NOT display well.

Upvotes: 3

Views: 1273

Answers (2)

Daniel YC Lin
Daniel YC Lin

Reputation: 16002

  • Install MSYS
  • Download mintty and put mintty.exe in c:\MinGW\msys\1.0\bin
  • Adjust MinGW Shell icon, set target as C:\MinGW\msys\1.0\msys.bat -mintty, then click the icon
  • Menu->Option->Text->Font, Locale,Character set(UTF-8)
  • Download go Windows 386
  • cd /c/go/src ; mkdir ; test your code here.
  • BTW, setting vim with utf-8

Upvotes: 1

Nate
Nate

Reputation: 5407

I will try this the next time I'm at a Windows XP machine. I develop mostly on Win 7 and CentOS. One thought, cmd.exe is awfully old on Windows XP. I wonder if it would work better if run from PowerShell. Also, in the last couple days I've switched to using MSys on Windows so that I can take advantage of unified makefiles on Linux and Windows. I'll post an update if I get the command to work on XP or 7.

Upvotes: 0

Related Questions