Page 1 of 1

Can't print certain characters.

Posted: Tue Jul 02, 2013 5:59 am
by Lemony Lime
I'd like to print some unusual ascii characters, and using the standard font/print I get the following error: "graphics.lua:1265: Decoding error: Invalid UTF-8"
And if I set notepad++ to encode it UTF-8 so it can actually display the character: "graphics.lua:1273: Decoding error: Invalid UTF-8"

An example:

Code: Select all

love.graphics.print( "█", 100, 100 )
I'm not sure what it means exactly. Any ideas?

Edit: I Just noticed that if I do this line, it prints the █ no problem:

Code: Select all

love.graphics.print( "â–ˆ", 100, 100 )
That's kind of a hassle to do though versus alt+219. What's the difference?

Re: Can't print certain characters.

Posted: Tue Jul 02, 2013 11:13 am
by raidho36
I just added love.graphics.print( "█", 100, 100 ) to my code and it instantly worked. My guess is that you have invalid UTF-8 encoding... hence the error. Make sure you encode your scripts as UTF-8 without BOM.

Re: Can't print certain characters.

Posted: Tue Jul 02, 2013 5:36 pm
by Lemony Lime
Well, shoot you're right. I didn't know what BOM was, so I just did UTF-8 encoding, and never tried that other option. Guess I should have. It works now, thanks.