[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Invalid char errors

Luiz Vitor Martinez Cardoso

1/5/2008 4:04:00 AM

[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

3 Answers

Paul Stickney

1/5/2008 4:12:00 AM

0

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.

Nobuyoshi Nakada

1/5/2008 4:17:00 AM

0

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-t...

There's the perfectly working example. ;)

--
Nobu Nakada

Luiz Vitor Martinez Cardoso

1/6/2008

0

[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.


On Jan 5, 2008 2:17 AM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:

> 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-t...
>
> There's the perfectly working example. ;)
>
> --
> Nobu Nakada
>
>


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

rubz.org - engineer student at maua.br