i18n: Factor out encoding categories from GUI into common code.