Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [science-iwg] Problem of HDF5 file with UTF8 file names on Windows

No. I did not contact HDF Group before.
I also found an interest thing. MATLAB R2015a can create unicode named hdf5 files and successfully read them and display their contents. 
MATLAB's h5disp() function can successfully read hdf5 file with unicode filename created by sis-jhdf5, but can't properly decode the utf-8 encoded dataset's name in displaying the meta information of hdf5 file.

Similarly, HDFView can open ascii-named hdf5 files which created by MATLAB, but can't properly display the unicode dataset name. 

All cases are tested in Chinese Windows 7.


Best regards,

Trig

2016-10-24 20:01 GMT+08:00 Jay Jay Billings <jayjaybillings@xxxxxxxxx>:

Hi Trig,

Have you tried contacting the HDF5 Group directly? Ted Habermann, CC'ed, might be able to direct you to someone at HDF5 who can help.

Jay


On Oct 24, 2016 1:31 AM, "Trig Chen" <trigchen@xxxxxxxxx> wrote:
Hi folks,
I'm using hdf5 to store data acquired from spectrometer and now encountering problem with UTF-8 filenames.
I use sis-jhdf5 library (https://wiki-bsse.ethz.ch/display/JHDF5, latest version 14.12.6) to write & read hdf5 files.  The writing codes is:
String name = "数据.h5";
IHDF5Writer writer = HDF5Factory.open(name);
writer.string().write("file_name", name);
writer.close();
That would create 2 file in current folder:  数据.h5 (0 KB) and 鏁版嵁.h5 (3 KB)

Then I use the flowing codes to retrieve data:
final IHDF5Reader reader = HDF5Factory.openForReading(name);
final String strName = reader.string().read("file_name");
reader.close();
System.out.println("name = " + strName);
 That would output: name = ??.h5

I used HDFView 2.13 (downloaded from HDF Group website) to open 数据.h5, it opened successfully. But I tried to open 鏁版嵁.h5, it failed.

If I wrote the hdf5 file with name "data.h5" and then rename it to "数据.h5" and then openned with HDFView, it alse failed.

If I copied data.h5 to another folder which the folder path contained unicode charaters, HDFView also failed to open the new copied data.h5. It threw exception when I used sis-jhdf5 to open the new copied data.h5:
Exception in thread "main" ncsa.hdf.hdf5lib.exceptions.HDF5FileInterfaceException: File accessibilty:Unable to open file ["..\..\src\H5FDsec2.c line 339 in H5FD_sec2_open(): unable to open file: name = 'D:\数据\data.h5'

I digged the web and found this was an old issue: 

HDF Group also noted this issue but had no plan to fix it:

I'm hesitate to use hdf5 continuously or change to other file store strategy such H2 database.

Any suggestions would be welcome.


Best regards,

Trig Chen

_______________________________________________
science-iwg mailing list
science-iwg@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/science-iwg

_______________________________________________
science-iwg mailing list
science-iwg@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/science-iwg


Back to the top