Jonathan Chayce Dickinson wrote:
> Hey,
>
> I came across the following article on CodeProject.
>
> http://www.codeproject.com/KB/dotnet/strings.aspx
>
> Could help us a bit, especially with the CHAR support for MS 0.0.2. I 
> look into it and see if I can get the CHAR type working.
>
Okay so I have done some reading and this is what I have:

String Type:

    * Has null terminator, for interopability with older Win32 code. We
      couldn't give a hoot about interop with Win32 code :).
    * Each char, is indeed, a fixed length UTF-16 (Unicode) bit sequence
      (2 bytes in length).
          o We should decide: UTF-16 or UTF-32 as a standard? Point for
            a meeting? UTF-16 has a smaller footprint, UTF-32 hits a
            much larger market.
    * Has a m_firstChar field. In the article this is a char, but I
      assume that it is a char*.
    * Two lengths are stored, one with the null terminator (no longer
      needed) and one that is the actual length.
          o Obviously drop the first.
          o The second is an Signed Int32. Why did they use signed ints?
            Can anyone come up with a good argument for this? Maybe we
            should use a UInt32 instead.

Final string structure:?:?:?:

UInt32 _stringLength;
Char * _firstCharacter;

Char:

Int16 _value; // Or UInt16?

Am I missing some of the complexity of the char?

xfury, there is a StringBuilder description there for you :).

-- 
                              Jonathan Dickinson


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
SharpOS-Developers mailing list
SharpOS-Developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sharpos-developers

Reply via email to