Move charset and locale name functions to their own files