Replaced lua file not working

Kuupora

Chieftain
Joined
Jul 8, 2013
Messages
11
Hello,

I have this little problem with my mod: When I try to run it, it get the following error in Lua.log:

[2957.903] Syntax Error:<file path>\UnitFlagManager.lua:1: unexpected symbol near 'ï'
[2957.903] Runtime Error: Error loading <file path>\UnitFlagManager.lua

Unit flag icons don't load at all when I have my mod activated. As far as I know the file paths are okay. I googled "unexpected symbol near 'ï'" problem and found that it might be caused by byte order mark in the code file. I also tried to convert UnitFlagManager.lua to "UTF-8 without BOM" and ANSI, (with notepad++) but that didn't help.

First I thought this could be caused by my user name becuse there was "ä" character. I changed that to no avail.

I have tried turning VFS on and off, it doesn't make any difference.

What am I doing wrong? :confused:
 
I modded for weeks with "Éa" in my mod's project name. Everything was fine (the mod could be built and modified) until I tried to add a new file. Then I saw the error above (except that I saw a "box" character in the error line; I can't remember if it was where you see 'i' or between "symbol" and "near"). The É wasn't anywhere in the file text but I guess it was in the file metadata. Sounds close to your situation. When I changed the project name everything was fine again.

Note: these characters work fine inside an xml file (I use them in many texts).
 
Thanks for your answer! It seems my problem was after all the byte order mark within the UTF-8 encoded lua file. For some reason my ModBuddy chose to save lua files with wrong encoding (:crazyeye:). I finally got rid of it by converting the encoding in notepad++ to "UTF-8 without BOM" and save as -> overwrite the existing file. (regular save didn't do the trick)

There is also a following the procedure to do the same thing within Modbuddy (actually visual studio):

http://stackoverflow.com/questions/5406172/utf-8-without-bom

However that method didn't work for me. Only the notepad++ method works.
 
Back
Top Bottom