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

listen(::UTF8String) throws error #9435

Closed
amitmurthy opened this issue Dec 21, 2014 · 2 comments
Closed

listen(::UTF8String) throws error #9435

amitmurthy opened this issue Dec 21, 2014 · 2 comments
Labels
io Involving the I/O subsystem: libuv, read, write, etc. unicode Related to unicode characters and encodings

Comments

@amitmurthy
Copy link
Contributor

julia> listen(UTF8String("/tmp/ewewew"))
ERROR: `bind` has no method matching bind(::PipeServer, ::UTF8String)
Closest candidates are:
  bind(::PipeServer, ::ASCIIString)

listen(path::ByteString) which calls bind(server::PipeServer, name::ASCIIString) is the issue. I assume that bind can be changed to accept a ByteString without any issues?

@ivarne ivarne added the unicode Related to unicode characters and encodings label Dec 26, 2014
@ihnorton ihnorton added the io Involving the I/O subsystem: libuv, read, write, etc. label Dec 30, 2014
@stevengj
Copy link
Member

I agree. bind calls uv_pipe_bind, which seems to support UTF-8 strings. The Windows uv_pipe_bind explicitly converts the name from UTF-8 to UTF-16 and calls CreateNamedPipeW. On Unix, I think UTF-8 should be allowed too for sockaddr_un.sun_path in bind (Unix pathnames are usually cookies, and any ASCII superset is permitted).

@stevengj
Copy link
Member

Actually, you can just use AbstractString here, not ByteString. Arbitrary string types will be converted by bytestring to UTF-8 as needed (see 4c72d02) for the ccall.

(Several of the other functions need to be changed from ByteString to AbstractString as well.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
io Involving the I/O subsystem: libuv, read, write, etc. unicode Related to unicode characters and encodings
Projects
None yet
Development

No branches or pull requests

4 participants