Fix text field width, window height with text field, cursor
position when there are spaces at the end of the input text,
non-ASCII characters handling.

FIRST STABLE VERSION FOR 1.4

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>