<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>263489</bug_id>
          
          <creation_ts>2011-01-17 23:58:57 +0000</creation_ts>
          <short_desc>Add support for (wide) character strings</short_desc>
          <delta_ts>2011-08-13 23:41:26 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>okteta</product>
          <component>Structures Tool</component>
          <version>unspecified</version>
          <rep_platform>Ubuntu</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>wishlist</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brad Hards">bradh</reporter>
          <assigned_to name="Alex Richardson">arichardson.kde</assigned_to>
          <cc>kossebau</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1074865</commentid>
    <comment_count>0</comment_count>
    <who name="Brad Hards">bradh</who>
    <bug_when>2011-01-17 23:58:57 +0000</bug_when>
    <thetext>Version:           unspecified (using KDE 4.5.1) 
OS:                Linux

[This relates to my work on an Okteta Structure Definition for Compound File Binary File Format, which is described in MS-CFB specification]

It would be nice to have ability to handle strings (including wide character strings). MS-CFB describes a 64 byte block, which is an array of up to 31 UTF-16 characters followed by a null terminator. I&apos;d like to be able to show the text (as a unicode string), but the best I can do is an array of 32 elements of uint16, which isn&apos;t so easy to read.

&lt;array name=&quot;Directory Entry Name&quot; length=&quot;32&quot;&gt;
  &lt;primitive type=&quot;UInt16&quot; /&gt;
&lt;/array&gt;

Some options that could be considered:
 - treat it as an array (as I do now), but add an extra attribute that shows how it should be rendered (like display=&quot;number&quot;, display=&quot;string&quot;)
 - add a new primitive type (like type=&quot;string&quot;) and some attributes for fixed length, null terminated, ucs2/utf8/ascii.
 - add several new primitive types (like type=&quot;FixedLengthString&quot;, type=&quot;FixedLengthWideString&quot;, type=&quot;NullTerminatedString&quot;, type=&quot;NullTerminatedWideString&quot;)

The display attribute could be used to avoid conflicts between char and int8/uint8, but I recognise that this would still require backwards-compatibility hacks.


Reproducible: Always

Steps to Reproduce:
Its probably easiest to see in a file with UTF-16 strings.

I can provide the .osd and .desktop that I&apos;m working on, if required. 

Actual Results:  
Display is a vertical display of the array in hex.

Expected Results:  
I&apos;d prefer to show the string</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1074894</commentid>
    <comment_count>1</comment_count>
    <who name="Alex Richardson">arichardson.kde</who>
    <bug_when>2011-01-18 01:03:54 +0000</bug_when>
    <thetext>Better support for strings is already on my TODO list.
I wanted to add support for null terminated ASCII C-strings, null terminated utf8,
null terminated and fixed length UTF16 and UTF32.

Probably Latin1 with configurable charset would also be a good idea.

I&apos;m afraid I&apos;m fairly busy the next weeks, but should have enough time to implement this in February.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1114828</commentid>
    <comment_count>2</comment_count>
    <who name="Alex Richardson">arichardson.kde</who>
    <bug_when>2011-05-04 13:53:03 +0000</bug_when>
    <thetext>SVN commit 1230377 by arichardson:

Add basic support for strings in structures.
Currently supported encodings are ASCII and UTF16-LE/BE.
Strings can be added to.osd by using the &lt;string&gt; element. 
Strings can have a fixed length (byte count or character count), 
be terminated by a certain unicode code point, or both (whichever occurs first)


CCBUG: 263489

 M  +6 -0      CMakeLists.txt  
 M  +0 -6      view/structures/datatypes/abstractarraydatainformation.cpp  
 M  +2 -3      view/structures/datatypes/abstractarraydatainformation.h  
 M  +22 -11    view/structures/datatypes/datainformation.cpp  
 M  +21 -10    view/structures/datatypes/datainformation.h  
 M  +6 -1      view/structures/datatypes/datainformationbase.cpp  
 M  +3 -2      view/structures/datatypes/datainformationbase.h  
 A             view/structures/datatypes/dummydatainformation.cpp   [License: LGPL]
 A             view/structures/datatypes/dummydatainformation.h   [License: LGPL]
 M  +0 -5      view/structures/datatypes/dynamiclengtharraydatainformation.h  
 A             view/structures/datatypes/strings (directory)  
 A             view/structures/datatypes/strings/asciistringdata.cpp   [License: LGPL]
 A             view/structures/datatypes/strings/asciistringdata.h   [License: LGPL]
 A             view/structures/datatypes/strings/stringdata.cpp   [License: LGPL]
 A             view/structures/datatypes/strings/stringdata.h   [License: LGPL]
 A             view/structures/datatypes/strings/stringdatainformation.cpp   [License: LGPL]
 A             view/structures/datatypes/strings/stringdatainformation.h   [License: LGPL]
 A             view/structures/datatypes/strings/utf16stringdata.cpp   [License: LGPL]
 A             view/structures/datatypes/strings/utf16stringdata.h   [License: LGPL]
 M  +2 -2      view/structures/datatypes/topleveldatainformation.h  
 M  +86 -8     view/structures/parsers/osdparser.cpp  
 M  +3 -2      view/structures/parsers/osdparser.h  
 M  +11 -10    view/structures/structtool.cpp  
 M  +3 -0      view/structures/structtreemodel.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&amp;revision=1230377</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1153604</commentid>
    <comment_count>3</comment_count>
    <who name="Alex Richardson">arichardson.kde</who>
    <bug_when>2011-08-13 21:15:38 +0000</bug_when>
    <thetext>Closing this bug, since Latin1, UTF8 and UTF32 have been added by now</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1153632</commentid>
    <comment_count>4</comment_count>
    <who name="Brad Hards">bradh</who>
    <bug_when>2011-08-13 23:41:26 +0000</bug_when>
    <thetext>Thanks for this functionality, and all your other work too. Much appreciated.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>