title: Is there a way to convert string to binary data to reduce size?
body: <p>I implemented Huffman coding (it is a study task). I get some text string as input, and I produce some result string, like as: "011010 00101 0110 0101 0110 0101 0111 0000 0010 0000 0110 0010 0110 1111 0110 1111 0111 0000 0010 0000 0110 0010 0110 0101 0110". </p>
  
  <pre><code>string some_text = read_text_file_to_string(text_file);
  
  string coded_string = encode_string(some_text); // coded_string == "011010 00101 0110 0101..."
  </code></pre>
  
  <p>Is there a way to transform <strong>coded_string</strong> to binary format and write it to file? My aim is reducing size of input data. But, if I write <strong>coded_string</strong> to file, I get more bigger a file.</p>