timholy/HDF5.jl — pull request #65 by carlobaldassi (2013-12-19 11:01:13+00:00)
Title: Allow generic ByteStrings as names

This closes #64: it seems to work fine, and all tests pass. However, my testing did not go beyond `include("runtests.jl")` and some simple use cases, and I may well have missed something. Example:

```
julia> jldopen("tst.jld", "w") do f
write(f, "ä", 1234);
end

julia> jldopen("tst.jld") do f
dump(f)
end
JldFile len 1
ä: Core.Int64

julia> @load "tst.jld";

julia> ä
1234
```

A possible concern is that (IIUC) this violates the [HDF5 spec](http://www.hdfgroup.org/HDF5/doc/H5.intro.html#Intro-ODatasets) ("A dataset name is a sequence of alphanumeric ASCII characters"); however, this is already violated, in that non-alphanumeric names are already allowed (e.g. there is nothing preventing the use of names such as `"$#a"`). My understanding (or rather, hope) is that everything should work fine as long as you pass a null-terminated `Uint8` array to the library, and convert it back to the appropriate type when reading it back (which fortunately `bytestring` does for us).