totalcross
totalcross copied to clipboard
Special characters returned by SQLITE, are breaking, but not when used directly in the code
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
Expected behavior
The especial characters should work as is on inputing the text directly to the label
Screenshots or videos
Devices:
Please complete the following information:
- Device: Motorola One Fusion
- OS: Android
- OS Version: 10
- TotalCross Version: Branch Release/7.0.0
Also reproducible using win32
On the simulator:
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
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