app: Only allow valid charsets

Charsets must be [-_A-Za-z0-9] only.

https://bugzilla.gnome.org/show_bug.cgi?id=730390