This way we can use it at other places, for example when preparing URLs for format_table_set_url()
This is high-level functionality, and fits better in shared/ (which is for our executables), than in basic/ (which is also for libraries).