Summary: Invalid UTF8 data makes RB crash
Product: REALbasic
ProductVersion: 4.5
Component: Application
Severity: Crash
CC: realbasic-nug at lists dot realsoftware dot com
Reproduce: In a new project, put an EditField and a PushButton. Set the
EditField's font to "System.UTF8". Set it's initial text to "t?st" (the '?'
should be generated by pressing option-e followed by another e, and note that
the '?' character is not preserved on saving the project). Put the following
code in the PushButton:
dim s as String
s = EditField1.text
s = midb(s, 1, 2) + midb(s, 4, 2)
EditField1.text = s
This chops out one byte of the multibyte '?' character, producing an invalid
UTF8 string, then inserts the invalid string in the EditField.
Reproducible: Always
OSVersion: 10.1.5
CPUType: PowerPC
SubmittedOn:
REALbugsVersion: 1.4.2
Description: Putting invalid UTF8 data into an EditField (with the font set to
"System.UTF8") or passing it to a text converter can crash RB 4.5 with a failed
assertion error. The message is:
Runtime Failure: Failed Assertion. Please report [... etc ...]
ATSUEdit.cpp:214
WorkaroundNotes: Try not to let your UTF8 strings get messed up!
Workaround: 1
|