Skip to content

Commit

Permalink
Fixed string handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dawbarton committed Dec 20, 2018
1 parent 7bb44ad commit 1d6495d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MAT_HDF5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,9 @@ function read(obj::HDF5Object, ::Type{MatlabString})
data = reshape(data, sz[2:end])
end
if ndims(data) == 1
return convert(String, convert(Vector{Char}, data))
return String(convert(Vector{Char}, data))
elseif ndims(data) == 2
return datap = String[rstrip(convert(String, convert(Vector{Char}, vec(data[i, :])))) for i = 1:size(data, 1)]
return datap = String[rstrip(String(convert(Vector{Char}, vec(data[i, :])))) for i = 1:size(data, 1)]
else
return data
end
Expand Down

0 comments on commit 1d6495d

Please sign in to comment.