Well, we do support UTF-8 characters, so if your text editor supports UTF-8 you can enter them. UTF-8 isn’t the same as high ASCII and can’t be indexed like ASCII characters, they are multi-byte characters. Your last example should work, if a) the font supports them and b) your editor is in UTF-8 mode.
I then highlighted the extended characters and cut and pasted them in my draw.newText command.
Still nothing on screen.
I know this must work as I have a store in my game that I set up a couple of test accounts and set one of my devices to Great Britain and then put my game on that device. My store logic retrieved the localized price as a string and lo and behold the draw.newText was able to output £0.69 on the screen.
I am so frustrated as to what I am doing wrong. The font used in both cases above is the same and has those characters in it.
I have a feeling I am doing something trivial wrong but I just can’t put my finger on it.
It seemed to work for me with Sublime 2. I’m on a Mac, I don’t know if Windows in interfering with you or not. I’m guessing you are using Windows by trying to use 164 to draw a copyright symbol. I copied and pasted from the forums into my editor.
Thanks so much for your succintct reply. I downloaded Sublime for the Mac (I have a Mac also but prefer the PC), cut the text from the forum as you indicated, pasted it into the draw.newText, saved the file as a UTF-8 format and presto!
It worked!
Took the main.lua back into Windows and into EditPad Pro 7 and took a look at the draw.newText command and here is
I’m by no means a UTF-8 expert, but it is multi-byte. I think that when it sees a high bit set, it reads a value which is the number of bytes and then one byte as necessary for the character sequence or something. I don’t think you can safely copy/paste that one character, though it probably would work for those specific characters.
Well, we do support UTF-8 characters, so if your text editor supports UTF-8 you can enter them. UTF-8 isn’t the same as high ASCII and can’t be indexed like ASCII characters, they are multi-byte characters. Your last example should work, if a) the font supports them and b) your editor is in UTF-8 mode.
I then highlighted the extended characters and cut and pasted them in my draw.newText command.
Still nothing on screen.
I know this must work as I have a store in my game that I set up a couple of test accounts and set one of my devices to Great Britain and then put my game on that device. My store logic retrieved the localized price as a string and lo and behold the draw.newText was able to output £0.69 on the screen.
I am so frustrated as to what I am doing wrong. The font used in both cases above is the same and has those characters in it.
I have a feeling I am doing something trivial wrong but I just can’t put my finger on it.
It seemed to work for me with Sublime 2. I’m on a Mac, I don’t know if Windows in interfering with you or not. I’m guessing you are using Windows by trying to use 164 to draw a copyright symbol. I copied and pasted from the forums into my editor.
Thanks so much for your succintct reply. I downloaded Sublime for the Mac (I have a Mac also but prefer the PC), cut the text from the forum as you indicated, pasted it into the draw.newText, saved the file as a UTF-8 format and presto!
It worked!
Took the main.lua back into Windows and into EditPad Pro 7 and took a look at the draw.newText command and here is
I’m by no means a UTF-8 expert, but it is multi-byte. I think that when it sees a high bit set, it reads a value which is the number of bytes and then one byte as necessary for the character sequence or something. I don’t think you can safely copy/paste that one character, though it probably would work for those specific characters.
I was having the same problem while working on a Windows machine. I use Notepad++ for editing. Changing to UTF-8 encoding did not work for me. HOWEVER, changing to “Encode in UTF-8 without BOM” did the trick! I guess there’s more than one flavor of UTF-8?
I was having the same problem while working on a Windows machine. I use Notepad++ for editing. Changing to UTF-8 encoding did not work for me. HOWEVER, changing to “Encode in UTF-8 without BOM” did the trick! I guess there’s more than one flavor of UTF-8?