in progress...
[jalview.git] / forester / ruby / evoruby / lib / evo / io / parser / fasta_parser.rb
index e4c35d9..f1da2a9 100644 (file)
@@ -1,18 +1,14 @@
 #
 # = lib/evo/io/parser/fasta_parser - FastaParser class
 #
-# Copyright::  Copyright (C) 2006-2007 Christian M. Zmasek
-# License::    GNU Lesser General Public License (LGPL)
+# Copyright::    Copyright (C) 2017 Christian M. Zmasek
+# License::      GNU Lesser General Public License (LGPL)
 #
-# $Id: fasta_parser.rb,v 1.11 2010/10/08 22:04:17 cmzmasek Exp $
-#
-# last modified: 05/17/2007
+# Last modified: 2017/02/07
 
 require 'lib/evo/io/parser/msa_parser'
 require 'lib/evo/msa/msa'
 
-require 'iconv'
-
 module Evoruby
 
   class FastaParser < MsaParser
@@ -26,10 +22,10 @@ module Evoruby
       current_seq = String.new()
       name        = String.new()
       saw_first_seq = false
-      ic = Iconv.new( 'UTF-8//IGNORE', 'UTF-8' )
       File.open( path ) do | file |
         while line = file.gets
-          line = ic.iconv( line )
+          
+          line.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => "?")          
           if can_ignore?( line, saw_first_seq )
 
           elsif line =~ /^\s*>\s*(.+)/