bytes or chars ?

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Sep 16 14:52:44 CDT 2004


On 9/16/04 2:20 PM, "Erik Mueller-Harder"
<valentina-list at vermontsoftworks.com> wrote:

> I believe Ruslan has said that we will at some point in the future be
> able to modify a field's storage encoding after it's been created.  It
> seems to me that this is a compelling argument for sticking with bytes
> all the time; otherwise, what would happen in the following case, with
> characters used for UTF16 and bytes for UTF8:
> 
> myString = VString(50, "UTF16")  // 50 characters = 100 bytes in UTF16
> 
> and some weeks later this is changed/added in code:
> 
> myString.StorageEncoding = "UTF8"

Good point, Erik!

 
> The inconsistency of using bytes in one instance and characters in
> another leads us into further uncertainty.  Obviously, Valentina would
> need to interpret the "50" as either continuing to refer to characters
> (but that wouldn't make sense, since character size is unknown in
> UTF-8) or as now referring to bytes (but that wouldn't make sense,
> since it would then have to change the field from taking up 100 bytes
> to taking up 50 -- and developers would be upset that Valentina was
> doing "sneaky" things behind their backs)....  And then we'd face the
> same difficulty in situations where UTF-8 fields were changed to
> UTF-16.

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina-beta mailing list