mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 20:28:17 +08:00
commit
4255417cc3
@ -62,9 +62,14 @@ func prepare(xmlbyte []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
charset := mahonia.GetCharset(matchStr[1])
|
xmlEncode := "UTF-8"
|
||||||
|
if len(matchStr) == 2 {
|
||||||
|
xmlEncode = matchStr[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
charset := mahonia.GetCharset(xmlEncode)
|
||||||
if charset == nil {
|
if charset == nil {
|
||||||
return errors.New(fmt.Sprintf("not support charset:%s", matchStr[1]))
|
return errors.New(fmt.Sprintf("not support charset:%s", xmlEncode))
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.EqualFold(charset.Name, "UTF-8") {
|
if !strings.EqualFold(charset.Name, "UTF-8") {
|
||||||
|
Loading…
Reference in New Issue
Block a user