Page 2 of 2

Re: Accept input from scandinavian characters æøåäöå

Posted: Sat Oct 13, 2012 10:38 pm
by Robin
Przemator wrote:with unicode, the backspace might be tricky...
Actually, UTF-8 makes that really easy:

Code: Select all

	if key == "backspace" then
		local last
		repeat
			last = line:sub(-1):byte()
			line = line:sub(1, -2)
		until line == "" or last < 0x80 or last >= 0xc0
	end