totalcross icon indicating copy to clipboard operation
totalcross copied to clipboard

Special characters returned by SQLITE, are breaking, but not when used directly in the code

Open VicMisael opened this issue 4 years ago • 3 comments

Describe the bug

When using sqlite to return a string, it breaks on all versions from 5.1.4 to the branch release/7.0.0

To Reproduce

Just compile the following code and run it on Android

Sqlite.zip

Expected behavior

The especial characters should work as is on inputing the text directly to the label

Screenshots or videos

image

Devices:

Please complete the following information:

  • Device: Motorola One Fusion
  • OS: Android
  • OS Version: 10
  • TotalCross Version: Branch Release/7.0.0

VicMisael avatar Jan 07 '21 17:01 VicMisael

Also reproducible using win32 image On the simulator: image

VicMisael avatar Jan 08 '21 10:01 VicMisael

Doing some tests on windows,It seems like when deployed to some platforms, it uses a different set of bytes for String on Sqlite, this may be related to encoding of characters on sqlite.

I modified the code that I sent to print every set of bytes for each Char on the string(On windows it will write to a file)

Using ordinary java String

aáãíííí 0x0061 0x00E1 0x00E3 0x00ED 0x00ED 0x00ED 0x00ED

Retrieving from sqlite

aýýýýýý 0x0061 0x003F 0x003F 0x003F 0x003F 0x003F 0x003F

VicMisael avatar Jan 08 '21 11:01 VicMisael

The issue is also present on Linux_ARM, so maybe related to all platforms(Not tested on Ios neither Linux_x86)

a������ 0x0061 0x00E1 0x00E3 0x00ED 0x00ED 0x00ED 0x00ED Total ST12.3 0x0054 0x006F 0x0074 0x0061 0x006C 0x0020 0x0053 0x0054 Total L�quido + ST12.3 0x0054 0x006F 0x0074 0x0061 0x006C 0x0020 0x004C 0x003F 0x0071 0x0075 0x0069 0x0064 0x006F 0x0020 0x002B 0x0020 0x0053 0x0054 Total L�quido + ST + IPI24.6 0x0054 0x006F 0x0074 0x0061 0x006C 0x0020 0x004C 0x003F 0x0071 0x0075 0x0069 0x0064 0x006F 0x0020 0x002B 0x0020 0x0053 0x0054 0x0020 0x002B 0x0020 0x0049 0x0050 0x0049 Valor total fat.12.3 0x0056 0x0061 0x006C 0x006F 0x0072 0x0020 0x0074 0x006F 0x0074 0x0061 0x006C 0x0020 0x0066 0x0061 0x0074 0x002E a������24.6 0x0061 0x003F 0x003F 0x003F 0x003F 0x003F 0x003F

the bytes outputed are the same on win32

2021-01-08-125554_1440x900_scrot

VicMisael avatar Jan 08 '21 13:01 VicMisael