Fixed textinput height calculation based on padding

Also fixed encoding declaration for textinput.py