Corona fails compile when main.lua saved as UTF-8 with BOM

Subject: Corona fails compile when main.lua saved as UTF-8 with BOM
Corona Version: 2009.10.01
System Version: Mac Mini OS 10.6.1
iPhone/iPod generation: 3G iPhone
iPhone/iPod firmware version: 3.1

Severity - 3 Important(doesn’t function as planned)

Reproducibility: Every time

Description:
When main.lua is saved as UTF-8 with Byte Order Mark, Corona fails to
compile. This happens for both Simulator and Build-for-device.

Steps to reproduce:

  1. Open Hello World project in Bare Bone’s Text Wrangler
  2. Replace “Hello World” string with “???”
  3. Save (It’ll ask to save as UTF-8 since the Chinese string can’t be
    encoded with Mac Roman)
  4. Open in Corona command line app, and the console will complain of a
    syntax error
  5. Same results using GUI version of Corona Simulator
  6. In Text Wranger, choose Save-As and choose encoding as Unicode, UTF-8 no BOM
  7. Corona now compiles successfully for both simulator and on phone. [import]uid: 238 topic_id: 172 reply_id: 300172[/import]

Thank you, I’ve submitted your bug to our bugbase.

-Jeff [import]uid: 5 topic_id: 172 reply_id: 166[/import]

Jeff,

Any chance Ansca could make entering bugbase entries available to us. It’s annoying entering bugs via a forum, plus the forum has no search function so dupes can easily happen.

Also - can we adjust the session timeout on the forum so it’s longer? I’d had a couple of tabs open before with bug entries, but after I filled out all the info, the session had already timed out for the forum.
The bug entry UX is … shall we say … suboptimal.

Thanks,

  • Ian [import]uid: 238 topic_id: 172 reply_id: 171[/import]

Ian

we are going to change the time out session and we are looking at various options to enter bugs into our bug base directly instead of the forum

thanks

carlos [import]uid: 24 topic_id: 172 reply_id: 174[/import]

Thanks Carlos.

Would be great to enable search on the forums as well. As time goes on, we’ll see more and more code snippets that would be helpful to search for.

Cheers,

  • Ian [import]uid: 238 topic_id: 172 reply_id: 176[/import]

we have a new dev website with search features that should be online in a few days

carlos [import]uid: 24 topic_id: 172 reply_id: 177[/import]

Can someone tell me if this bug is ongoing. If I save my main.lua file as UTF8 it then won’t load and gives an error. I have to save as ANSI.

Also, how do I print a pound sign (£) in Lua with display.newText()?

Most frustrating. Also, on these forums, there seems to be no forum for debugging and coding questions? Which one do I use? [import]uid: 116752 topic_id: 172 reply_id: 78909[/import]

amaninkent, I’ll have to look into your first question.

For the others;

  1. [lua]local myText = display.newText(“£”, 100, 100, native.systemFont, 18)[/lua]

  2. Developer support is for all questions related to development. If your question is more specific (Android only, or game logic) we also have some forums available for that. (Namely Android and Game Development, respectively.)

Peach :slight_smile: [import]uid: 52491 topic_id: 172 reply_id: 79108[/import]

Thanks Peach. I must have missed the Developer Forum. doh.

As for the statement:

local myText = display.newText("£", 100, 100, native.systemFont, 18)  

it just renders gibberish characters in the simulator. If I save as UTF-8 I get errors all over the place, so I save as ANSI. I use notepad on Windows 7, and I don’t think it has inserted a BOM. I don’t really want to install another editor, I love notepad :slight_smile:

Is there a problem using Notepad? [import]uid: 116752 topic_id: 172 reply_id: 79125[/import]

Hey Amaninkent,

It renders fine for me, although I’m on a Mac and don’t currently have access to a PC to test on.

I am no expert in Windows however I am aware users have had issues in the past when using certain editors, including Mac’s notepad alternative, TextEdit.

I would suggest using LuaEdit; http://luaedit.sourceforge.net/download.html

Then test the code using the latest stable Corona build (704) and if the £ symbol still doesn’t display properly file a bug report using the link in the top right hand corner the site.

Peach :slight_smile: [import]uid: 52491 topic_id: 172 reply_id: 79190[/import]

i could not get windows notepad or macs notepad to work for encoding utf-8.

Widows luaEdit also does not seam to work for utf-8, however my windows is xp, control panel >languages >advance > is set to english, it may work differently with other settings. I have had problems with xp in the past for unicode.

solution: download www.pspad.com

open file > format > utf-8 // then save as

I strongly recommend luaEdit for main.lua then just use a language.lua with pspad
Now I am able to use Russian in my app.

[import]uid: 89663 topic_id: 172 reply_id: 99425[/import]