select mime_charset
from ad_locales
where locale = :locale
select locale
from ad_locales
where language = '[db_quote $language]'
and enabled_p = 't'
and (default_p = 't' or
(select count(*)
from ad_locales
where language = '[db_quote $language]') = 1
)