Accept input from scandinavian characters æøåäöå

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post 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
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests