Re: Accept input from scandinavian characters æøåäöå
Posted: Sat Oct 13, 2012 10:38 pm
Actually, UTF-8 makes that really easy:Przemator wrote:with unicode, the backspace might be tricky...
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