Skip to content
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

UTF16String API updates #12

Closed
stevengj opened this issue May 29, 2014 · 2 comments
Closed

UTF16String API updates #12

stevengj opened this issue May 29, 2014 · 2 comments

Comments

@stevengj
Copy link
Member

In preparation for JuliaLang/julia#7016 or similar changes, you should replace UTF16String(data) by utf16(data) and length(s.data) by sizeof(s) >> 1.

@PallHaraldsson
Copy link

I see "length" "-1" in the code, is this maybe already fixed (in a different way)? Was this forgotten or want to use size? For performance reasons? Length would have to scan the whole string (in case of non-BMP).

@stevengj
Copy link
Member Author

Yes, looked like @nolta fixed it in 0cc11e2 without cross-referencing this issue.

The only downside to using length(s.data)-1 is that it depends on the internal representation of UTF16String, so if the NUL-termination is ever removed this will have to change again.

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

No branches or pull requests

2 participants