Skip to content

Instantly share code, notes, and snippets.

@zhang0098
zhang0098 / gbkbig5.go
Last active September 14, 2022 13:32
Golang GBK Big5 from/to UTF-8 转换
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)
@zhang0098
zhang0098 / init.lua
Created December 10, 2022 07:25
Hammerspoon input method auto switch
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