mirror of
https://github.com/go-vgo/robotgo
synced 2026-05-23 17:59:12 +00:00
Update to utf-code function Fixed #189
This commit is contained in:
parent
8297ed4a8f
commit
235139bced
1 changed files with 5 additions and 5 deletions
10
robotgo.go
10
robotgo.go
|
|
@ -700,12 +700,12 @@ func CharCodeAt(s string, n int) rune {
|
|||
func toUC(text string) []string {
|
||||
var uc []string
|
||||
|
||||
textQuoted := strconv.QuoteToASCII(text)
|
||||
textUnquoted := textQuoted[1 : len(textQuoted)-1]
|
||||
for _, r := range text {
|
||||
textQ := strconv.QuoteToASCII(string(r))
|
||||
textUnQ := textQ[1 : len(textQ)-1]
|
||||
|
||||
strUnicodev := strings.Split(textUnquoted, "\\u")
|
||||
for i := 1; i < len(strUnicodev); i++ {
|
||||
uc = append(uc, "U"+strUnicodev[i])
|
||||
st := strings.Replace(textUnQ, "\\u", "U", -1)
|
||||
uc = append(uc, st)
|
||||
}
|
||||
|
||||
return uc
|
||||
|
|
|
|||
Loading…
Reference in a new issue