Hello,

I read / write strings in my HDF files to copy data between Matlab and my C++ 
code. I have some problems with ASCII Codes greater 127 in my files. 

The dump of a HDF5 file (Matlab) shows:
GROUP "/" {
DATASET "data" {
   DATATYPE  H5T_STRING {
         STRSIZE 2;
         STRPAD H5T_STR_NULLTERM;
         CSET H5T_CSET_ASCII;
         CTYPE H5T_C_S1;
      }
   DATASPACE  SIMPLE { ( 4 ) / ( 4 ) }
   DATA {
   (0): "\37777777744", "\37777777766", "\37777777774", "\37777777737"
   }
}
}

The chars are "ä", "ö", "ü", "ß". My code creates the same chars of a string 
with string.c_str() to:
GROUP "/" {
DATASET "test" {
   DATATYPE  H5T_STRING {
         STRSIZE 3;
         STRPAD H5T_STR_NULLTERM;
         CSET H5T_CSET_ASCII;
         CTYPE H5T_C_S1;
      }
   DATASPACE  SIMPLE { ( 4 ) / ( 4 ) }
   DATA {
   (0): "\37777777703\37777777644", "\37777777703\37777777666",
   (2): "\37777777703\37777777674", "\37777777703\37777777637"
   }
}
}

It seems that my code create 2 bytes for the ä, ö, ü, ß and Matlab 1 byte. Can 
I switch the encoding in the HDF5 file or can I use unicode or anything else?

Thanks

Phil
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to