IonicWind Software

IWBasic => Tutorials => Topic started by: Andy on August 25, 2018, 06:53:24 AM

Title: Unicode DataBase
Post by: Andy on August 25, 2018, 06:53:24 AM
You might be interested in this at some point.

This is an example of how to store Unicode data in a database.

I'm not going to cover the database side of things much, but it does work.

What I'm doing is using a lot of Fasecero's code (thanks!), storing the data in the database as an ISTRING, then converting it back to Unicode to display on screen.

The data is stored like this:

192,3,187,3,192,3,187,3,201,3,169,3,192,3,187,3,187,3,192,3,201,3,201,3,169,3,168,3,168,3,0,0

and not this:

πλπλωΩπλλπωωΩΨΨ

When saving (updating) a record, it's converted to a string representation of the Unicode string and saved, the reverse happens when displaying the data.

Plus:

Allows you to store Unicode date.
Data is not easily read by the average user.

Minus:
Takes up a lot more space.
Conversion is needed to make any sense of the data.
I had to set the product field from "Text" to "Memo" as "Text is limited to 255 characters - not enough!

The main section to look at is "CopyData()"

I'm sure you will find possible errors / problems, it only covers text typed from left to right, but it does work, at least for one table.

Andy.