// Charset set charset when create table, only support mysql now
488292
func (engine *Engine) Charset(charset string) *Session {
	session := engine.NewSession()
	session.IsAutoClose = true
	return session.Charset(charset)
}
490686
func (u *URLs) Set(s string) error {
	for _, t := range strings.Split(s, ",") {
		url, err := url.Parse(t)
		if err != nil {
			return err
		}

		*u = append(*u, *url)
	}

	return nil
}
609830
func (sf SizeFlag) Set(raw string) error {
	i := 0
	for ; i < len(raw) && raw[i] >= '0' && raw[i] <= '9'; i++ {
	}
	val, err := strconv.ParseInt(raw[:i], 10, 64)
	if err != nil {
		return err
	}
	// constant map so concurrent access is ok.
	mult, found := sizeFlagMap[strings.ToLower(raw[i:])]
	if !found {
		return fmt.Errorf("Invalid syntax: %q, supported syntax is 0-9+(k|m|g|t)[i]", raw)
	}
	*sf.v = val * mult
	return nil
}
97158
func (c *CharSet) canonicalize() {
	var i, j int
	var last rune

	//
	// Find and eliminate overlapping or abutting ranges
	//

	if len(c.ranges) > 1 {
		sort.Sort(singleRangeSorter(c.ranges))

		done := false

		for i, j = 1, 0; ; i++ {
			for last = c.ranges[j].last; ; i++ {
				if i == len(c.ranges) || last == utf8.MaxRune {
					done = true
					break
				}

				CurrentRange := c.ranges[i]
				if CurrentRange.first > last+1 {
					break
				}

				if last < CurrentRange.last {
					last = CurrentRange.last
				}
			}

			c.ranges[j] = singleRange{first: c.ranges[j].first, last: last}

			j++

			if done {
				break
			}

			if j < i {
				c.ranges[j] = c.ranges[i]
			}
		}

		c.ranges = append(c.ranges[:j], c.ranges[len(c.ranges):]...)
	}
}
487571
func (b *UpdateBuilder) Set(col interface{}, val interface{}) *UpdateBuilder {
	b.Update.Exprs = append(b.Update.Exprs, makeUpdateExpr(b.table, col, val))
	return b
}
977334
func (kv *KeyValue) Set(key, value string) error {
	if !kv.host.rawUTF8 {
		Encode(&value)
	}
	if _, err := kv.Get(key); err != nil {
		// Key does not exist, create it
		_, err = kv.host.db.Exec(fmt.Sprintf("INSERT INTO %s (attr) VALUES ('\"%s\"=>\"%s\"')", pq.QuoteIdentifier(kvPrefix+kv.table), escape(key), escape(value)))
		return err
	}
	// Key exists, update the value
	_, err := kv.host.db.Exec(fmt.Sprintf("UPDATE %s SET attr = attr || '\"%s\"=>\"%s\"' :: hstore", pq.QuoteIdentifier(kvPrefix+kv.table), escape(key), escape(value)))
	return err
}
735614
func StringsSet(in []string) map[string]struct{} {
	if in == nil {
		return nil
	}
	out := make(map[string]struct{})
	for _, v := range in {
		out[v] = struct{}{}
	}
	return out
}
445329
func (s *SubsetFontObj) CharIndex(r rune) (uint, error) {
	/*
		if index, ok := s.CharacterToGlyphIndex[r]; ok {
			return index, nil
		}
		return 0, ErrCharNotFound
	*/
	glyIndex, ok := s.CharacterToGlyphIndex.Val(r)
	if ok {
		return glyIndex, nil
	}
	return 0, ErrCharNotFound
}
98807
func (sa *StringsValue) Set(s string) error {
	*sa = append(*sa, s)
	return nil
}
1076519
func (p *parser) addUnitSet(set *CharSet) {
	p.unit = newRegexNodeSet(ntSet, p.options, set)
}
1050018
func (s *SimpleEmailPart) SetCharset(v string) *SimpleEmailPart {
	s.Charset = &v
	return s
}
537306
func (client *Client) SetLanguage(langs ...string) error {
	if len(langs) == 0 {
		return fmt.Errorf("languages cannot be empty")
	}

	client.Languages = langs

	client.flagForInit()

	return nil
}
47684
func (db *CLevelDB) Set(key []byte, value []byte) {
	key = nonNilBytes(key)
	value = nonNilBytes(value)
	err := db.db.Put(db.wo, key, value)
	if err != nil {
		panic(err)
	}
}
1191585
func (f *int64SliceFlag) Set(val string) error {
	i, err := strconv.ParseInt(val, 10, 64)
	if err != nil {
		return errors.Reason("values must be 64-bit integers").Err()
	}
	*f = append(*f, i)
	return nil
}
901630
func (sa *StringValue) Set(s string) error {
	*sa = StringValue(s)
	return nil
}
631400
func (s *Content) SetCharset(v string) *Content {
	s.Charset = &v
	return s
}
449786
func (s *DBInstance) SetCharacterSetName(v string) *DBInstance {
	s.CharacterSetName = &v
	return s
}