trichview.com

trichview.support




Re: unicode encoding


Return to index


Author

Message

Sergey Tkachenko

Posted: 02/05/2005 20:52:55


> Hello Sergery,

>

> Just a couple of questions:

>

> 1. Do I need to change any of the code ? in particular where it says

'FieldName'

> I don't think so but I want to make sure.


No, you can use it as it is. But I wrote it directly in my newsgroup client,

so it may contain some misprints.


> 2. Where do I place the following code :-

>

> table.First;

> while not table.Eof do

> begin

>   LoadRVFFromField(rv, table, 'french');

>   // GetAllText() is defined in the unit RVGetTextW.

>   // Do not use here the function with the same name

>   // from RVGetText unit!

>   SaveTextToField(RVEncodeWidestring(RVGetTextW.GetAllText(rv)),

>     table, 'frenchUTF');

>   table.Next;

> end;


It's the main code doing the conversion from the 'french' field to the

'frenchUTF' field.

It calls two procedures defined above (LoadRVFFromField and

SaveTextToField).

Place it in any place where you can execute it when you need, for example in

OnClick of some button.

This code goes through all record of the table. For all records, it loads

the content of 'french' to rv and then save it as encoded text to

'frenchUTF'.


table is a table containing these records.

rv: TRichView - place it on the form, link to TRVStyle (it's own RVStyle,

different from others), hide it (set its Visible property to False).


>

> 3. How would I call this feature with a buttonclick, or does it all happen

> behind the scenes

> and automatically update if I add new table records (meaning it does not

need a

> button )?


Yes, just call this code in button's OnClick





Powered by ABC Amber Outlook Express Converter