title: Why does my array read from file contain bytes
body: <p>I'm writing a little system that parses lines of data in a txt separated by commas,
  so to be basic about it I read the file lines into an array, then use .each on the array and split everything by "'" then push it into the holding array which is returned as the database made from the file, I have made two, the first works fine but its data is stored line by line with a keyword, this one works fine, access and return all good.</p>
  
  <p>I'm using a file containing text data like this</p>
  
  <hr>
  
  <pre><code>476,TACKLE,40,25,30,0,0,1,A3F,move description string with, punctuation and t's
  477,ANOTHERATTACK,BLAHBLAHBLAH,1,2,3,4
  </code></pre>
  
  <hr>
  
  <p>This would be data parsing kind of right, well </p>
  
  <p>so I go:</p>
  
  <hr>
  
  <pre><code>$fs  = File_SYstem.new
  @path = Dir.getwd.to_S + "/desktop/file.txt"
  @data_lines = $fs.file_read_lines(@path)
  @data = []
  @data_lines.each do |line|
    @data &gt;&gt; line.split(',')
  end
  return @data
  #this would make an array of the lines, each line being an array of its elements, right?
  
  @data = The_Code_Above_In_A_Class.new(@path)
  =&gt;@data
  
  @data[0]
  =&gt;"354,FISSURE,10,40,50,blah blah blah, the second half of the text."
  
  #hmmmm
  
  @data[0][0]
  =&gt;"354"
  </code></pre>
  
  <p>So it seems to work fine, but some times, the numbers at the beginning come back as bytes :O</p>
  
  <p>And for example:</p>
  
  <pre><code>@data.each do |line|
    puts line[1].to_S #return second element which is name of move
  end
  </code></pre>
  
  <p>This would print a list of the expected names, fine and dandy, but then I get the remaining data I didn't ask for returned below it in an unrecognizable pattern.</p>
  
  <p>Maybe I can do this?</p>
  
  <pre><code>array = [1,2,3]
  array = [array,array,array]
  array[2][0] = "Hello!"
  array.each do |item|
    puts item[2]
  end
   =&gt;"3"
  "3"
  "Hello!"
  =&gt;:
  </code></pre>
  
  <hr>
  
  <p>Seems to me this should work since I'm already using close variations of this style somewhere else with success.</p>
  
  <p>Now this is a sample of the real 580 line file:</p>
  
  <hr>
  
  <pre><code>1,MEGAHORN,Megahorn,000,120,BUG,Physical,85,10,0,00,0,abef,Cool,"Using its tough and  impressive horn, the user rams into the target with no letup."
  2,ATTACKORDER,Attack Order,000,90,BUG,Physical,100,15,0,00,0,befh,Smart,The user calls out its underlings to pummel the target. Critical hits land more easily.
  3,BUGBUZZ,Bug Buzz,046,90,BUG,Special,100,10,10,00,0,bek,Cute,The user vibrates its wings to generate a damaging sound wave. It may also lower the target's Sp. Def stat.
  </code></pre>
  
  <hr>
  
  <p>Now this is the class I use to load it up:</p>
  
  <pre><code>class Move_Data_Extracter
    def initialize(path)
          load $path.to_s + "/source/string_helper.rb"
      #load "/mnt/sdcard/pokemon/system/source/string_helper.rb"
          @path = path.to_s
      @file_lines = $file_system.file_read_lines(@path.to_s)
      $movedata = []
      @file_lines.each do |line|
        $movedata &lt;&lt; line.split(",")
      end
    end
    def get_move_id(move_name)
      $movedata.each do |move|
        if move[1].upcase.to_s == move_name.upcase.to_s
              return move[0].to_i
        else
          return "Move Doesnt Exist In The System!"
        end
      end
    end
   end
  </code></pre>
  
  <hr>
  
  <p>This is the feedback I got when I accessing the first item in the returned array(s?):</p>
  
  <hr>
  
  <pre><code>irb(main):002:0&gt; $movedata[0]
  =&gt; ["\xEF\xBB\xBF1", "MEGAHORN", "Megahorn", "000", "120", "BUG", "Physical", "8
  5", "10", "0", "00", "0", "abef", "Cool", "\"Using its tough and impressive horn
  ", " the user rams into the target with no letup.\"\n"]
  irb(main):003:0&gt; $movedata[0][0]
  =&gt; "\xEF\xBB\xBF1"
  irb(main):004:0&gt;
  </code></pre>
  
  <p>Access worked ok this time but the first element is bytes and that each method I'm trying is going so wrong.</p>
  
  <p>Can anyone figure out whats wrong here?</p>