Search Field Text Encoding?

Before I raise this as a bug, is there a particular reason why the Search Field desktop control appears to be storing it’s contents as a 16-bit (UTF-16) string? I thought Xojo was meant to handle all internal strings in UTF-8?

I discovered this when I couldn’t work out why my URL query call wasn’t working correctly. Then when I did some debugging I found that the text content of the control was being stored as 16-bits per character. So the phrase “test” for example, was being urlencoded to t%00e%00s%00t%00 and not being understood by the server.

I’ve swapped back to using an ordinary Text Field control for now as I don’t really need to use the search field but thought I’d raise this in case anyone else has encountered it.

Tested with Xojo 2021r2.1 on Windows. I have not checked if Mac or Linux have this problem

Mac does not have the problem, Linux unknown. Fixed in 2021r3.

https://documentation.xojo.com/resources/release_notes/2021r3.html

65281 Framework » Windows SearchField Text property is now properly encoded as UTF8 on Windows.

1 Like

I had a similar problem before. It is better to use Björn’s SearchControl.