1. Sergey Pashkov
  2. Valentina Database ADK
  3. Wednesday, August 21 2019, 11:39 AM
  4.  Subscribe via email
Recently we discovered that the Xojo project may contain Byte Order Mark in the source code.
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 ), "" )
Attachments (3)
Comment
There are no comments made yet.


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories