[Improvement suggestion] HDFView should support adding UTF-8 string attributes


#1

To reproduce:

  1. Run HDFView.

  2. Create HDF5 file test.h5.

  3. Add attribute “test”. Specify Datatype class as STRING, String Length
    7, Value “Привет!”. Not that it’s not possible to specify the UTF-8
    encoding (but hopefully HDFView deduces it from the actual string?).

  4. View attribute value: it is displayed correctly.

  5. Run h5dump on the file created. It outputs:

HDF5 "test.h5" {
GROUP "/" {
    ATTRIBUTE "test" {
       DATATYPE  H5T_STRING {
          STRSIZE 7;
          STRPAD H5T_STR_NULLTERM;
          CSET H5T_CSET_ASCII;
          CTYPE H5T_C_S1;
       }
       DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
       DATA {
       (0): 
"\37777777717\37777777760\37777777750\37777777742\37777777745\37777777762"
       }
    }
}
}

The data was stored using CSET H5T_CSET_ASCII despite it contains
non-ASCII characters.

Best wishes,
Andrey Paramonov


#2

Hi Andrey,

Thank you for suggestion! I entered HDFVIEW-206

HDFView project is not open yet; it is next on our list to open to the Community.

Thank you!

Elena