Invalid char errors

  • Thread starter Luiz Vitor Martinez Cardoso
  • Start date
L

Luiz Vitor Martinez Cardoso

[Note: parts of this message were removed to make it a legal post.]

Yeah! I`m learning to program in ruby but i can`t understand what i`m
getting char erros!

My code:

#!/usr/bin/ruby

class Teste
def initialize(nome, sobrenome, idade)
@nome = nome
@sobrenome = sobrenome
@idade = idade
end
end

class Impressora < Teste
def printer
puts @nome
puts @sobrenome
puts @idade
end
end

@pessoa = Impressora.new("a", "b", 10)
@pessoa.printer


The ouput:

m0bile > ./teste.rb
/teste.rb:14: Invalid char `\302' in expression
/teste.rb:14: Invalid char `\240' in expression


I`m on Mac Leopard

--
Regards,
Luiz Vitor Martinez Cardoso [Grabber].
(11) 8187-8662

rubz.org - engineer student at maua.br
 
P

Paul Stickney

Use an editor/viewer that will show characters outside of the normal
ASCII range and then remove them.
Or, delete and retype the line.

Ruby *code* (excluding Strings, etc with unicode) must be proper ASCII.
 
L

Luiz Vitor Martinez Cardoso

[Note: parts of this message were removed to make it a legal post.]

Oh! Thanks i`m using TextMate and i activate "Show invisible" and see a
wrong caracter outside the ASCII ;)

Thanks!

Regards,
Luiz Vitor.


Hi,

At Sat, 5 Jan 2008 13:12:07 +0900,
Paul Stickney wrote in [ruby-talk:286160]:
Use an editor/viewer that will show characters outside of the normal
ASCII range and then remove them.
Or, delete and retype the line.

Or, copy&paste from
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/286159

There's the perfectly working example. ;)


--
Regards,
Luiz Vitor Martinez Cardoso [Grabber].
(11) 8187-8662

rubz.org - engineer student at maua.br
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,187
Latest member
RosaDemko

Latest Threads

Top