When BOM is inside the query text, database engines (SQLite, Valentina DB) are unable to execute this query, showing errors, not so easy to understand (BOM is invisible in error messages and logs, we can see it only in HEX form).
According to the user report, this problem appeared after the copy/paste operation.
Different APIs are affected - V4RB, REST.
Here's how a BOM can be found:
- In the HEX-editor. When you open such a project, you can see UTF8 BOM (EF BB BF) inside the quoted string (see xojo_bom_project_hex.png).
- In the Xojo IDE. When debugging, check the memory of such a string - UTF8 BOM is in it (see xojo_bom_string_as_binary.png).
It is not easy to fix it on the database engine side, as it will require to search for BOMs in all strings, so it would be better if Xojo could erase them once after opening.
Currently, there are a few ways to fix this project:
1) Recommended by Xojo support
1: Highlight the text (possibly the entire method)
2: Open the code editor context-menu (normally a right-click with the mouse)
3: Select "Clean invisible ascii characters"
That way, invisible characters are replaced with another character, by default it is '•' (not removed).
And then we have to use find/replace to remove them all.
2) Open the project in the HEX-editor and remove BOM manually (https://www.dropbox.com/s/ln23dm602iexo48/Xojo_Remove_BOM.mp4?dl=0)
3) Retype suspected string, including quotes.
4) Remove BOMs using Xojo code, for example, for iOS app:
inQuery.ReplaceAll( Text.FromUnicodeCodepoint(&hFEFF ), "" )