Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby 1.9 and unicode

Reply
Thread Tools

Ruby 1.9 and unicode

 
 
Marcin Raczkowski
Guest
Posts: n/a
 
      01-15-2008
Well i tried to play a little with new unicode features.


i wanted to do something like this:

def Σ(*args)
args.inject(0){|sum,el| sum+el}
end

and use it like Σ[1,2,3,4]

BUT:

swistak@sreberko:~$ irb1.9
irb(main):001:0> # -*- encoding: utf-8 -*-
irb(main):002:0* Σ(1,2,3)
=> nil
swistak@sreberko:~$

--------------------------

swistak@sreberko:~$ irb1.9
irb(main):001:0> def Σ(*args)
SyntaxError: compile error
(irb):1: syntax error, unexpected $end
from (irb):1:in `Kernel#binding'
swistak@sreberko:~$

-------------------------
as you can see it's droping back to shell after i type unicode character in.

I'm using Debian etch. Gnome + gnome terminal.

Any ideas?

 
Reply With Quote
 
 
 
 
Tiziano Merzi
Guest
Posts: n/a
 
      01-15-2008
Marcin Raczkowski wrote:
> Well i tried to play a little with new unicode features.
>
>
> i wanted to do something like this:


> Any ideas?


I try with netbeans and from command in windows: it works!
But not with irb.

You ca try with a script and run the script with ruby interpreter

tiziano
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Marcin Raczkowski
Guest
Posts: n/a
 
      01-15-2008
Tiziano Merzi wrote:
> Marcin Raczkowski wrote:
>> Well i tried to play a little with new unicode features.
>>
>>
>> i wanted to do something like this:

>
>> Any ideas?

>
> I try with netbeans and from command in windows: it works!
> But not with irb.
>
> You ca try with a script and run the script with ruby interpreter
>
> tiziano


Strange, anyone can confirm that behavior? mayby some compiler flags ?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python unicode utf-8 characters and MySQL unicode utf-8 characters Grzegorz ¦liwiñski Python 2 01-19-2011 07:31 AM
Help for Unicode char and Unicode char based string in Ruby Chirag Mistry Ruby 6 02-08-2008 12:45 PM
unicode wrap unicode object? ygao Python 6 04-08-2006 09:54 AM
Unicode in Ruby and a Ruby Reference Mike McGavin Ruby 9 12-15-2004 09:04 AM
Unicode + jsp + mysql + tomcat = unicode still not displaying Robert Mark Bram Java 0 09-28-2003 05:37 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57