Problem with String and Text

MacOS 10.12.3
Xojo 2017R1
Compiling to macOS environment.

The issue I am having is accessing a TextArea.Text variable and ONLY occurs when compiled with 64 bit. My program code goes like this:

SQLText.SelText = "£" dim s27 As String = SQLText.Text s27.FixString dim s() As String = s27.Split(EndOfLine)
The FixString method is defined as:

Public Sub FixString(extends byref st As string) st = st.DefineEncoding(Encodings.UTF8) st = ReplaceLineEndings(st, EndOfLine) End Sub
In a 32 bit compiled app I can see the “£” as “£” in one of the s() lines. In a 64 bit compiled app the “£” is shown in the debugger as a diamond and, therefore, I can’t find it when searching using Instr.

Can someone point me in the right direction as to how I can use the Classic string handling in a 64 bit application?

Thanks all.

st = st.DefineEncoding(Encodings.UTF8)

this should only run if st.encoding is nil. Like this:

if st.encoding = nil then st = st.DefineEncoding(Encodings.UTF8) end if

Thank you, Christian, I implemented the changes.

Unfortunately that did not fix the issue.

Any other suggestions?

What encoding does the text have?
What bytes do you actual see?

In the binary view of the debugger it is C2. This is displayed as the diamond with a ? inside. And then, of course, the £ character is not being seen in my subsequent processing.

Could it be that encoding is something different like ISO Latin?

I have found a workaround.

I still have the problem but, as it now doesn’t affect me, I am shelving the issue until I have some time to review it again.

Thank you, Christian, but don’t worry about for now.