3 ms·
What about encodings - is this "left as an exercise for the console"? I love ZMQ but couldn't imagine using a netcat-like tool without ability to specify inbou
by sk5t 15y ago
What about encodings - is this "left as an exercise for the console"? I love ZMQ but couldn't imagine using a netcat-like tool without ability to specify inbound or outbound text encoding, or serialization format / protobuf, etc.
- rumcajz 15y agoI guess you can contribute serialisisaion formats to the project.
- technoweenie 15y agoZMQ is specifically content agnostic. It looks like zmqc is too. As zacharyvoase pointed out, you'd just pipe the output of messages to other tools that can handle JSON/MsgPack/Protobufs/whatever.
- zacharyvoase 15y agoThe UNIX way is, indeed, to leave this as an exercise to the console. You can use a tool like iconv to convert between encodings; the primary draw of zmqc is that everything is on stdin/stdout. For example: zmqc ... | iconv -f iso-8859-1 -t utf-8 If I'd added information on serialisation formats to the program, it would have become very bloated very quickly. JSON, BSON, XML, protobuf, bencode…where does one stop? And besides, since it's stdout, how does one losslessly represent that format without using the format itself?
- sk5t 15y agoAahhh, I didn't have my head on straight from writing so many non-console programs with ZMQ; you are certainly right about using iconv here.