-
Notifications
You must be signed in to change notification settings - Fork 65
Revert string transcode changes #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
yuyichao
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing new line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why prefer a newline?
|
ok fixed. mind merging this one? |
|
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.0which is UTF-8 vs. entering the same thing into MATLAB directly: >> x = 'λ';
>> x(1)+0
ans =
955which is the actual Unicode codepoint. |
|
Interesting, I see the same problem on both on this commit and on master |
|
The |
|
See #80 for the fix to encode strings properly on construction. |
add a test and trim leading whitespace