Support for user's locale based input encoding

Allow to input characters in the encoding defined by the user's current
locale. This commit also introduces support for more sophisticated input
method, e.g. seek input position via arrow keys. However this feature is
not included in the frame input module, due to its design simplicity.