Skip to content

Conversation

@musm
Copy link
Collaborator

@musm musm commented Nov 6, 2016

add a test and trim leading whitespace

Copy link
Contributor

@yuyichao yuyichao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

FWIW, I don't see why the original change was needed.

test/mxarray.jl Outdated


str = "λ α γ"
@test jstring(mxarray(str)) == str
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing new line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why prefer a newline?

@musm
Copy link
Collaborator Author

musm commented Nov 6, 2016

ok fixed. mind merging this one?

@simonster
Copy link
Member

simonster commented Nov 6, 2016

I'm not sure this is actually right. It seems to round trip, but I think that's just because we aren't converting properly on either end. If you put UTF-8 into MATLAB you will get UTF-8 out, but MATLAB's internal encoding appears to be UCS-2. Compare:

julia> str = "λ";

julia> mat"$str(1)+0"
206.0

which is UTF-8 vs. entering the same thing into MATLAB directly:

>> x = 'λ';
>> x(1)+0

ans =

   955

which is the actual Unicode codepoint.

@musm
Copy link
Collaborator Author

musm commented Nov 6, 2016

Interesting, I see the same problem on both on this commit and on master

@simonster
Copy link
Member

The transcode change should have fixed how strings come out of MATLAB, but it didn't fix how we put strings into MATLAB, so that makes sense.

@simonster
Copy link
Member

See #80 for the fix to encode strings properly on construction.

@musm musm closed this Nov 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants