mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-07 09:03:57 +00:00
Merge pull request #249 from go-vgo/dev
Update to utf-code function Fixed #189
This commit is contained in:
commit
bfa0ad7821
10
robotgo.go
10
robotgo.go
@ -700,12 +700,12 @@ func CharCodeAt(s string, n int) rune {
|
|||||||
func toUC(text string) []string {
|
func toUC(text string) []string {
|
||||||
var uc []string
|
var uc []string
|
||||||
|
|
||||||
textQuoted := strconv.QuoteToASCII(text)
|
for _, r := range text {
|
||||||
textUnquoted := textQuoted[1 : len(textQuoted)-1]
|
textQ := strconv.QuoteToASCII(string(r))
|
||||||
|
textUnQ := textQ[1 : len(textQ)-1]
|
||||||
|
|
||||||
strUnicodev := strings.Split(textUnquoted, "\\u")
|
st := strings.Replace(textUnQ, "\\u", "U", -1)
|
||||||
for i := 1; i < len(strUnicodev); i++ {
|
uc = append(uc, st)
|
||||||
uc = append(uc, "U"+strUnicodev[i])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return uc
|
return uc
|
||||||
|
Loading…
Reference in New Issue
Block a user