From: brabuhr@... Date: 2011-03-09T08:52:30+09:00 Subject: Re: UTF-8 support - still stuck On Sun, Mar 6, 2011 at 2:47 AM, Thomas Luedeke wrote: > The script is: > > ======================================== > #! /bin/ruby -vU > #Encoding: UTF-8 > verb = "appèler" > if ${verb} =~ /èler/ then print "The verb was #{verb}" end > ======================================== > > note.rb:9: invalid multibyte char (UTF-8) > > note.rb:9: syntax error, unexpected tIDENTIFIER, expecting $end > > verb = "appΦler" Are you absolutely certain that your file is UTF-8 encoded? $ cat i.rb #Encoding: UTF-8 verb = "appèler" puts "The verb was #{verb}" if verb =~ /èler/ $ ruby -v i.rb ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0] The verb was appèler $ enca -L none i.rb Universal transformation format 8 bits; UTF-8 $ iconv -t LATIN1 -f UTF8 < i.rb > l.rb $ enca -L none l.rb Unrecognized encoding $ ruby -v l.rb ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0] l.rb:2: invalid multibyte char (UTF-8) l.rb:2: syntax error, unexpected tIDENTIFIER, expecting $end verb = "app?ler" ^