From becd777b1e2f4a0ce705bfac3a80517ab8ebbb2b Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Tue, 13 Feb 2018 12:37:39 +0800 Subject: [PATCH] Fix unicode chars in SQL --- scope.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scope.go b/scope.go index 14baf631..25077efc 100644 --- a/scope.go +++ b/scope.go @@ -649,12 +649,12 @@ func (scope *Scope) buildCondition(clause map[string]interface{}, include bool) buff := bytes.NewBuffer([]byte{}) i := 0 - for pos := range str { - if str[pos] == '?' { + for _, s := range str { + if s == '?' { buff.WriteString(replacements[i]) i++ } else { - buff.WriteByte(str[pos]) + buff.WriteRune(s) } }