Fix locale handling for input etc. on *nix.
Fix locale handling for input etc. on *nix.

Without this, some input, e.g. compose sequences, could be mangled.

I found that <compose> <apostrophe> <a> was causing ‘Ã¡’ to be input – this
just happens to be the result of conversion from Latin-1 to UTF-8 of ‘á’
when already represented as UTF-8.

DaemonEngine/Daemon,DaemonEngine/Daemon,DaemonEngine/Daemon,DaemonEngine/Daemon