Encoding: Add setlocale() to applications.

See also bug #14934 where chinese characters could not be used with cpack.
Merge topic 'setlocale' into next

730e3862 Encoding: Add setlocale() to applications.