Default maximal length for VarChar Re: VChar vs VText

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Dec 8 10:57:01 CST 2005


On 12/8/05 7:41 AM, "Ed Kleban" <Ed at Kleban.com> wrote:

>>>> Actually in v2 for UTF8 the best size of VarChar will be 2044.
>>>> 
>>> 
>>> Why?  Does this have to do with the natural page size of MacOS X or
>>> something?  
>> 
>> Yes. Best size of page is 4K
>> 
>> We assume that page should keep at least 2 records.
>> 
>> So max size *in bytes* for one record is (4K - header) / 2 = 2044
>>   
> 
> Ok,... but If I recall correctly, UTF8 does not work yet in V4RB 2.xx
> correct?   

right
 
> Is this true?  What bad things happen if I set db.StorageEncoding = UTF-8
> (whatever the correct syntax for that is)?

crashes
 
> If I must use UTF16 as my StorageEncoding, however I plan to use just simple
> ASCII 8-bit character strings in RB, then presumably I should declare my
> VarChar fields as VarChar( 1022 ) even though the test I am using in RB to
> determine if a string will fit is "LenB( aString ) <= 2044"

> Is this correct?

Not exactly
 
> Will Valentina be able to store strings in UTF-8 in the future?

Yes.

For field with single byte encoding, you will be able use VarChar[2044].

You know, may be you can TRY to mark some field as

    fld.StorageEncoding = "MacRoman" or "Latin1"

I am not sure if supported "ASCII"

May be such encoding will work. With UTF8 is problem that it have
non-predicated lengths in bytes for different languages.


-- 
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 mailing list