V4RB, Jon, project /// More explanation.

Ivan Smahin IvanSmahin at public.kherson.ua
Thu Sep 16 02:06:22 CDT 2004


Hello Ruslan,

Thursday, September 16, 2004, 12:36:53 AM, you wrote:

RZ> On 9/16/04 12:30 AM, "jda" <jda at his.com> wrote:

>>> 
>>>>> I suggest that 50 always means bytes, and if you want to store 50
>>>>>  UTF-16 characters that you declare a VString of [100]
>>>> 
>>>>  Agreed; that would be much more consistent.
>>> 
>>> I still do not think so.
>>> 
>> 
>> You make the final decision, of course. But as you said, we are *all*
>> developers on this list and would prefer to deal with bytes, not
>> characters. I assure you that if you mix the meaning of the number
>> parameter as a function of the type of encoding there will be lots of
>> problems (both with existing users and new users). And what happens
>> to existing data space if you change the encoding? Why create this
>> headache?

RZ> Okay, we will think one more about this.

RZ> Just also exists SQL standard

RZ> Also Ivan says that other DBMS "think" in chars.

 Frankly saying other DBMS prefer to mix such terms as
 characters and bytes. It seems - just for better understanding. :)

 On the one hand it's no difference for one-byte code-pages.
 So, here is ( char(10) ) no problem to say 10 bytes or 10 characters.

 On the other hand we need to differ bytes and characters case
 multi-byte codepages.
 
     For instance:

     It is from MS-SQL manual:

     char:
          Fixed-length non-Unicode character data with a maximum length of 8,000 characters.

          Fixed-length non-Unicode character data with length of n bytes.
          n must be a value from 1 through 8,000. Storage size is n bytes.


     nchar(n):
          Fixed-length Unicode data with a maximum length of 4,000 characters.
     
          Fixed-length Unicode character data of n characters.
          n must be a value from 1 through 4,000. Storage size is two times n bytes.


     Oracle is much more correct as usual:

     CHAR(size)
      Fixed-length character data of length size bytes.
      Maximum size is 2000 bytes. Default and minimum size is 1 byte.
 
     NCHAR(size)
       Fixed-length character data of length size characters or bytes,
       depending on the choice of national character set.
       Maximum size is determined by the number of bytes required to store each character,
       with an upper limit of 2000 bytes.
       Default and minimum size is 1 character or 1 byte, depending on the character set.
 
     
     
-- 
Best regards,
 Ivan                            mailto:IvanSmahin at public.kherson.ua



More information about the Valentina-beta mailing list