Return-To-The-Roots / s25client

Return To The Roots (Settlers II(R) Clone)
http://www.rttr.info
GNU General Public License v2.0
478 stars 77 forks source link

Crash when using UTF-8 special chars in lua-scripts #602

Closed Spikeone closed 8 years ago

Spikeone commented 8 years ago

When saving a lua file with unicode encoding (instead of utf-8) the game is not able to read the script at all.

The following message is printed: Lua error: ...s/Spike/Saved Games/Return To The Roots/MAPS/MISS201.lua:1: unexpe cted symbol near char(255)

The actual first line in the script is: ,-------------------------------------------------------------------------------

Flamefire commented 8 years ago

Solution: Use UTF-8. I would not allow anything else as we already have everything UTF-8

Spikeone commented 8 years ago

Well, we can't support those languages then in missions as we can not translate messages, thats the only downside I see

Flamefire commented 8 years ago

Nope. UTF-8 is an encoding for unicode. So support UTF-8 = All chars supported

Spikeone commented 8 years ago

When I start a game with a script saved as UTF-8 (thought that was standard but ANSI is the stnadard on windows I guess) which has the following content:

function onStart(isFirstStart) rttr:Log("ĹÔÔÔ.WLD") end

The game just crashes

Flamefire commented 8 years ago

That is a bug ;) Will look into that...

Flamefire commented 8 years ago

Closed by #604