TextImpICU.cpp

Any idea what could cause this error? Xojo 2019r3.2

image

an Unicode text conversion failed inside the Xojo framework.
If you can reproduce it, please report as issue with sample project.

Unfortunately I can’t reproduce the error. It happens to one user occasionally.

I’m getting similar error, except

RuntimeCore\TextImpICU.cpp 133
Failure Condition: utf8Str.Encoding() == kEncodingUTF8

I don’t get it when I run it out of IDE on Win10 machine, nor when I run the built app on same machine. But 2 other PCs (Win10) have this error with built app. I built on Mac with 2024 2.1 and on PC with same. Same results.

Can you reproduce the error?

1 Like

I was able to get it to happen in IDE - there has to be a serial read. Generated an issue #77360. Error seems to be happening here:

dim myName as string
dim isUnset as Boolean = true
dim myString as string = trim(SamiProperties.SAMIname)
For Each codePoint As UInt32 In myString.Codepoints
If codePoint < 255 Then
isUnset = false
End If
Next

1 Like

Not a useful example as it can’t be run to reproduce the issue.

The good news is that William found the culprit from other reports and marked it fixed for the next release.

You know, UTF8 has rules, those “random streams” were inputting bytes that had broken those rules.

I think it could fire an exception when breaking such rules somewhere but not an assertion.

I’ve tried to recreate it in a test-app with a small snippet of code using the values I find in the debugger on crash but had no success. The trimmed string is (in one case) AP0036. Before trim there are 10 spaces before that (ASCII 20). In the structure it is set up as string of length 16 to allow user a name up to that length. Tried both trimmed and untrimmed. I’ve tried iterating as UInt8 instead of Uint32.

I guess I should add that I only see this on Win build. The Mac version of app has no issue.

Now we just need to wait and see the result.

In the off chance someone else encounters this in the meantime, I found that explicitly defining the encoding to UTF8 fixed it. From my snippet above, the 3rd line becomes:

dim myString as string = trim(SamiProperties.SAMIname.DefineEncodings(Encodings.UTF8))