[VREV] IOEncoding

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Oct 25 12:37:47 CDT 2005


On 10/25/05 6:35 AM, "ron barber" <rbarber at yhb.att.ne.jp> wrote:

Hi Ron,

> In the Kernal docs and the V4REV docs there is a discussion of
> "VDataBase_StorageEncoding( dbRef, [inStrValue] )  " (and a similar
> call for VTable and VField) but nothing about "VDatabase_IOEncoding"
> yet the V4REV example stacks call the "VDatabase_IOEncoding".

> Did the name change somewhere in development or am I confusing two
> things?

This is 2 different things.

* Storage encoding -- this is how we store strings on disk.

    For now work only UTF16 encoding. Best for Japan btw.
    We must yet todo UTF8 storage encoding.

* IO Encoding

    this is encoding of string which you assign to some Field Value.

        fldName = "Ron"     // can be UTF16

        fldName = "Ron"     // can be UTF8 or any other encoding
                                of the world

Engine work in UTF16, so if you give something else it must convert that
string. But how Engine know that? Answer is: you inform about this using

    db.IOEncoding( "UTF8" ) -- I promise give you UTF8 strings.

 
>> 3. But  database could be saved as UTF16 encoding (implemented) so UTF8
>>    one (not implemented yet).
> 
> I didn't understand no. 3.
> 
> I know that both REV and VAL use UTF16 internally.

yes

> I think I hear you saying that in order to talk to each other through
> the xcmd wrapper, the data must be converted to UTF8.

Yes, because external use old Rev SDK which do not support UTF16 and other
features yet

> This is done at creation of the db by
> 
> put VDatabase_Constructor() into mDBRef
>    get VDatabase_Create( mDBRef, path, "kDscDatBlbInd", 32 * 1024,
> "kOsDefault" )
>    get VDatabase_IOEncoding( mDBRef, "UTF-8" )
> 
> correct?

This only informs database that you will get/set strings in UTF8.
Now you yet should care that you really give to engine string in UTF8.
 
> So at this point, we V4REV users cannot take advantage of utf16
> encoding of V4REV.

Unfortunately yes.

> All our db's must be encoded in utf8 until Rev
> changes the wrapper of xcmds to allow in/output of utf16?

Right.

Note, Database in disk will be in UTF16.

Its your code will have this UTF8 conversion.
So I recommend put this into separate method,
So when REV will be improved you can "correct" your code by one function
modification.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina-beta mailing list