code: func ResolveCharsetCollation(tblCharset, dbCharset string) (string, string, error) {
  	if len(tblCharset) != 0 {
  		defCollate, err := charset.GetDefaultCollation(tblCharset)
  		if err != nil {
  			// return terror is better.
  			return "", "", ErrUnknownCharacterSet.GenWithStackByArgs(tblCharset)
  		}
  		return tblCharset, defCollate, nil
  	}
  
  	if len(dbCharset) != 0 {
  		defCollate, err := charset.GetDefaultCollation(dbCharset)
  		if err != nil {
  			return "", "", ErrUnknownCharacterSet.GenWithStackByArgs(dbCharset)
  		}
  		return dbCharset, defCollate, errors.Trace(err)
  	}
  
  	charset, collate := charset.GetDefaultCharsetAndCollate()
  	return charset, collate, nil
  }
docs: // ResolveCharsetCollation will resolve the charset by the order: table charset > database charset > server default charset.