Split(string) and text.split not returning same results - test code

Dim testString As String = "text" + Chr(31) + "text2" Dim testText As Text = "text" + Chr(31).ToText + "text2" Dim textAR() As Text Dim stringAR() As String textAR = testText.Split(Chr(31).ToText) stringAR = Split(testString,Chr(31))

stringAR is correct and textAR returns and array(10) where each value is empty.

Before I submit feedback/bug, am I missing a concept regarding the text type or doing something wrong to make the text.split yield a bad result?

Xojo 2018R1.1 Win10

From your test I get the same results in both arrays.
String(1)
Text(1)

[quote=392619:@Loannis Kolliageorgas]From your test I get the same results in both arrays.
String(1)
Text(1)[/quote]

What’s your OS and XOJO Version?

Yes, I get the same in each. An array of two items, “text” and “text2”. For both, the split seems to have occurred as required using chr(31) as the “unit separator” which is how chr(31) is described in the ASCII table.

@Chad: is that not what you were expecting?

I’m using Xojo 2018 v1.1 under macOS Mavericks.

Maybe it’s a windows thing only?

[quote=392625:@Tim Streater]Yes, I get the same in each. An array of two items, “text” and “text2”. For both, the split seems to have occurred as required using chr(31) as the “unit separator” which is how chr(31) is described in the ASCII table.

@Chad: is that not what you were expecting?

I’m using Xojo 2018 v1.1 under macOS Mavericks.[/quote]

Of course, I’m expecting to get the same results in both arrays.

Instead, I get this:

in textAR() each value is empty.

Try the test code in a new window or new projec you get the same results?
Maybe is something in your code?

Instead of Chr(31).ToText, try Text.FromUnicodeCodepoint(31).

I am using 2017 R3 and OSX

Still fails.

[quote=392631:@Loannis Kolliageorgas]Try the test code in a new window or new projec you get the same results?
Maybe is something in your code?[/quote]

Tried all methods above within a totally new project. Still fails.

It looks like it is a Windows thing.

Tested on Mac and got ubound 1 for both, remote debug on windows 10 got ubound 1 for string and 10 for text. Tested with 2018r1.1 and 2017r2.1

Yes, I just tried it in a Win7 VM with 2017 v2.1 and it fails as the OP described. Scope for feedback I would say.

thanks for testing.

Bug Submitted:
<https://xojo.com/issue/52512>

I believe there is a serious bug in the Find method of Text under Windows. I have a private report which I’ll request to be made public where I found that a Text.Replace or ReplaceAll with umlauts (Replace(“Ä”, “AE”)) will also change the usual vowels – which means “A” becomes “AE” too.
Currently private: <https://xojo.com/issue/52144>

[quote=392677:@Ulrich Bogun]I believe there is a serious bug in the Find method of Text under Windows. I have a private report which I’ll request to be made public where I found that a Text.Replace or ReplaceAll with umlauts (Replace(“Ä”, “AE”)) will also change the usual vowels – which means “A” becomes “AE” too.
Currently private: <https://xojo.com/issue/52144>[/quote]

Have the Xojo staff verified the bug in your case?

Yes.