Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Previously-supported string escape sequences no longer supported #8923

Closed
greay opened this issue May 14, 2024 · 1 comment
Closed

Previously-supported string escape sequences no longer supported #8923

greay opened this issue May 14, 2024 · 1 comment
Labels
bug Something is not working as expected

Comments

@greay
Copy link

greay commented May 14, 2024

Describe the bug (REQUIRED)
Prior to the latest version of Defold, this code was supported:

local emotes = {
	["\xF0\x9F\x99\x81"] = "slight frown", -- 馃檨
	["\xE2\x98\xB9\xEF\xB8\x8F"] = "sad",  -- 鈽癸笍
	["\xF0\x9F\x98\xAE"] = "surprised",    -- 馃槷
	["\xF0\x9F\x99\x82"] = "slight smile", -- 馃檪
	["\xF0\x9F\x98\x84"] = "smiling eyes", -- 馃槃
	["\xF0\x9F\x98\x86"] = "laughing",     -- 馃槅
	["\xF0\x9F\x98\xA0"] = "angry",        -- 馃槧
	["\xF0\x9F\x98\xA1"] = "very angry",   -- 馃槨
	["\xF0\x9F\xA4\xAC"] = "angry",        -- 馃が
}

To Reproduce (REQUIRED)
simply include the above code, and build

Expected behavior (REQUIRED)
builds without error

Defold version (REQUIRED):

Platforms (REQUIRED):
macOS

Minimal repro case project (OPTIONAL):
Please attach a minimal project where the bug is reproduced. This will greatly help the person trying to investigate and fix the bug.

Logs (OPTIONAL):

/main/portraits.lua
Line 50: Invalid escape sequence.(Supported in Lua 5.2/Lua 5.3/Lua 5.4/LuaJIT, current is Lua 5.1.)

@greay greay added the bug Something is not working as expected label May 14, 2024
@britzl
Copy link
Contributor

britzl commented May 15, 2024

I actually don't think those escape sequences will work in Lua 5.1.5, ie if you build for HTML5. BUT with that said, if you don't care about HTML5 then this is an annoying error preventing you from building.

A quick workaround is to use string.char() instead:

local emotes = {
	[string.char(0xF0, 0x9F, 0x99, 0x81)] = "slight frown", -- 馃檨
	[string.char(0xE2, 0x98, 0xB9, 0xEF, 0xB8, 0x8F)] = "sad",  -- 鈽癸笍
	[string.char(0xF0, 0x9F, 0x98, 0xAE)] = "surprised",    -- 馃槷
	[string.char(0xF0, 0x9F, 0x99, 0x82)] = "slight smile", -- 馃檪
	[string.char(0xF0, 0x9F, 0x98, 0x84)] = "smiling eyes", -- 馃槃
	[string.char(0xF0, 0x9F, 0x98, 0x86)] = "laughing",     -- 馃槅
	[string.char(0xF0, 0x9F, 0x98, 0xA0)] = "angry",        -- 馃槧
	[string.char(0xF0, 0x9F, 0x98, 0xA1)] = "very angry",   -- 馃槨
	[string.char(0xF0, 0x9F, 0xA4, 0xAC)] = "angry",        -- 馃が
}

@britzl britzl closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants