This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function Chinese() | |
-- hs.keycodes.currentSourceID("com.sogou.inputmethod.sogou.pinyin") | |
hs.keycodes.currentSourceID("com.apple.inputmethod.SCIM.ITABC") | |
end | |
local function English() | |
hs.keycodes.currentSourceID("com.apple.keylayout.ABC") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"bytes" | |
"io/ioutil" | |
"golang.org/x/text/encoding/traditionalchinese" | |
"golang.org/x/text/encoding/simplifiedchinese" | |
"golang.org/x/text/transform" | |
) | |
//convert GBK to UTF-8 | |
func Decodegbk(s []byte) ([]byte, error) { | |
I := bytes.NewReader(s) |