April 20, 2024, 02:48:24 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Unicode DataBase

Started by Andy, August 25, 2018, 06:53:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

August 25, 2018, 06:53:24 AM Last Edit: August 26, 2018, 05:59:47 AM by Andy
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.




Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.