# ------------------ # build_charset_list # ------------------ subroutine(build_charset_list(string default_charset), ( '\n'; if (default_charset ne "") then ( # ---------------------------- # get the group of the charset # ---------------------------- node charset_node = "templates.shared.util.charset.charset_structure"; node item; node subitem; string charset_string; bool group_found = false; foreach item charset_node ( charset_string = node_value(subnode_by_name(item, "set")); charset_string = replace_all(charset_string, " ", ""); if (node_exists("volatile.temp.charset")) then ( delete_node("volatile.temp.charset"); ); split(charset_string, ",", "volatile.temp.charset"); foreach subitem "volatile.temp.charset" ( if (node_value(subitem) eq default_charset) then ( group_found = true; last; ); ); if (group_found) then ( last; ); ); # ----------------- # sort charset list # ----------------- # Don't sort list, because of mixed letters and numbers use order as defined in charset_structure! # sort("volatile.temp.charset", "field:value,alphabetical,ascending"); # ------------------ # build options list # ------------------ node item; string charset_name; foreach item "volatile.temp.charset" ( charset_name = node_value(item); '\n'; ); ); ));