Hi,
The code below creates a native textfield with a listener plus a text object. If I run it on an iOS device (11.2.5) and type a single quote (’) in the textfield, the text object will correctly display a single quote, but the content of the textfield will NOT be a single quote but \M-b\M^@\M^Y.
Yes, I’m serious. All other special characters will display correctly but not the single quote. To make sure that this was not just a “print to console thing”, I used the utf8 library to search the text string and it is indeed \M-b\M^@\M^Y.
How is this possible? Has anyone else seen this?
local myText = display.newText({ text = "", x = 300, y = 700, height = 0, align = "left", font = native.systemFont, fontSize = 60 }) myText:setFillColor(1, 1, 1) local function listener(event) if (event.phase == "editing") then myText.text = event.text .. properties.cursorCharacter print(event.text) elseif (event.phase == "submitted") then print(event.target.text) end return true end local textField = native.newTextField(display.contentCenterX, 300, 200, 100) textField.isSecure = false textField.hasBackground = true textField.maxCharacters = 100 textField.inputType = "default" textField:setReturnKey("done") textField:addEventListener("userInput", listener)