Forum: Ruby Ruby ver, 2 o 1.9? & Problema con unicode

7b4dc398e90b0e18bf1b75b06f6c2caa?d=identicon&s=25 Steak Hutzeee (steak)
on 2014-06-02 14:07
Ciao a tutti, ho cominciato a dare un'occhiata a ruby. Ho installato la
versione 2.0.0 tramite il RubyInstaller. Anzitutto vorrei sapere se è
consigliato partire dalla versione 2 oppure dovrei cominciare dalla
1.9.3.
Inoltre ho un problema con dei programmi. All'inizio di essi io
inserisco la stringa "#encoding: utf-8", utilizzo caratteri accentati,
ma quando vado a compilare il programma mi viene restituito l'errore:
'invalid multibyte char (UTF-8) syntax error, unexpected tIDENTIFIER,
expecting end-of-input'.

A cosa è dovuto? Vi ringrazio in anticipo per le risposte :)
5b972395a92333843018b4add8af0437?d=identicon&s=25 Damián M. González (igorjorobus)
on 2014-06-03 16:21
Well this is a English speaking forum, but I think I understand your
problem. Is not sufficient to write "#encoding: utf-8" in the first line
of your *.rb files, also you have to set the encoding of the file from
your IDE to UTF-8. The both things will make stuff work as you want.
7b4dc398e90b0e18bf1b75b06f6c2caa?d=identicon&s=25 Steak Hutzeee (steak)
on 2014-06-03 18:26
Damián M. González wrote in post #1148700:
> Well this is a English speaking forum, but I think I understand your
> problem. Is not sufficient to write "#encoding: utf-8" in the first line
> of your *.rb files, also you have to set the encoding of the file from
> your IDE to UTF-8. The both things will make stuff work as you want.

Yes, you're right! I solved :)
D4df6f69f26d6d142bd87b7e27912e7b?d=identicon&s=25 Catalin Hagiu (catakin)
on 2014-06-11 21:35
Ciao, sono nuovo su Ruby e vorrei imparare questo linguaggio da zero.
se mi potreste dare delle guide per RUBY-JRUBI-RAIL-ECC..
se ce una Virtual Machine e i pregi/difetti.
vi ringrazio
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.