Problem seems to be in keyboard layout. ie. AltGr + space produces different byte sequence in us- and fi-layouts. This can be verified with following commands. (In both cases the space between quotes is typed by pressing AltGr+space)
$ setxkbmap us $ echo " " | hexdump 0000000 0a20 0000002
$ setxkbmap fi $ echo " " | hexdump 0000000 a0c2 000a 0000003
Problem seems to be in keyboard layout. ie. AltGr + space produces different byte sequence in us- and fi-layouts. This can be verified with following commands. (In both cases the space between quotes is typed by pressing AltGr+space)
$ setxkbmap us
$ echo " " | hexdump
0000000 0a20
0000002
$ setxkbmap fi
$ echo " " | hexdump
0000000 a0c2 000a
0000003