6

Is there a simple utility like printf that'll give me a "binary representation", i.e. a string like "01010010", from an input string? It would need to support multi-byte encodings.

1

2 Answers 2

14

xxd -b

(source)

0
3

You can also do this (and many other things) using figlet with the binary font.

$ echo foo | figlet -f binary
01100110 01101111 01101111 
3
  • @bahamat: I love the style of figlets big font output (+1 for that :) , but I there is not 'binary' format for version 2.2.2.. Commented Jul 30, 2011 at 19:17
  • I'm using 2.2.4, and I have the binary font. You have to download it from figlet.org (I already posted the link). Commented Jul 30, 2011 at 19:52
  • I downloaded binary.flf, and it works to just add a new .flf file to /usr/share/figlet... Now that I've actually tried it, I'll mention that unless you manually modify binary.flf, it does not convert spaces to binary... Commented Jul 31, 2011 at 1:57

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.