Commit bd1466fa authored by liaoqiang's avatar liaoqiang

fix when the first char is \, it cause UnquoteChar to return syntax error

parent 1b10364c
...@@ -488,6 +488,12 @@ func (d *Decoder) loadUnicode() error { ...@@ -488,6 +488,12 @@ func (d *Decoder) loadUnicode() error {
for len(sline) >= 6 { for len(sline) >= 6 {
var r rune var r rune
var err error var err error
for len(sline) > 0 && sline[0] == '\'' {
sline = sline[1:]
}
if len(sline) == 0 {
break
}
r, _, sline, err = strconv.UnquoteChar(sline, '\'') r, _, sline, err = strconv.UnquoteChar(sline, '\'')
if err != nil { if err != nil {
return err return err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment