title: Ruby - How to unpack a binary string into a normal string?
body: <p>I'm opening a CSV file and reading values from it using File.open(filename).</p>
  
  <p>So I do something like this:</p>
  
  <pre><code>my_file = File.open(filename)
  my_file.each_line do |line|
   line_array = line.split("\t")
   ratio = line_array[1]
   puts "#{ratio}"
   puts ratio.isutf8?
  end
  </code></pre>
  
  <p>The issue I'm having is the values in line_array seem to be in a strange format. For example one of the values in a cell of the CSV file is 0.86. When I print it out it looks like " 0 . 8 6"</p>
  
  <p>So it kind of behaves like a string but I'm not sure how it's encoded. When I try to do some introspection:</p>
  
  <pre><code>ratio.isutf8?
  I get this:
  =&gt; undefined method 'isutf8?' for "\0000\000.\0008\0006\000":String
  </code></pre>
  
  <p>What the heck is going on?! How do I get ratio into a normal string that I can then call ratio.to_f on?</p>
  
  <p>Thanks.</p>