auto_change_sub_encode.go 366 B

12345678910111213141516
  1. package settings
  2. type AutoChangeSubEncode struct {
  3. Enable bool `json:"enable"`
  4. DesEncodeType int `json:"des_encode_type"` // 默认 0 是 UTF-8,1 是 GBK
  5. }
  6. func (a AutoChangeSubEncode) GetDesEncodeType() string {
  7. if a.DesEncodeType == 0 {
  8. return "UTF-8"
  9. } else if a.DesEncodeType == 1 {
  10. return "GBK2312"
  11. } else {
  12. return "no support type"
  13. }
  14. }