Forum: Ruby What does this do?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Petr J. (Guest)
on 2009-04-16 06:41
Im trying to fix two libraries to be compatible with Ruby 1.9 - gruff
and pdf-writer,

and I came accross this:

SyntaxError:
/usr/local/lib/ruby/gems/1.9/gems/gruff-0.3.4/lib/gruff/mini/legend.rb:72:
invalid multibyte char (US-ASCII)
/usr/local/lib/ruby/gems/1.9/gems/gruff-0.3.4/lib/gruff/mini/legend.rb:72:
invalid multibyte char (US-ASCII)
/usr/local/lib/ruby/gems/1.9/gems/gruff-0.3.4/lib/gruff/mini/legend.rb:72:
syntax error, unexpected $end, expecting ':'
...ength < label.to_s.length ? "â¦" : '')

This is the gruff code:

truncated_label + (truncated_label.length < label.to_s.length ? "â^À¦" :
'')

What does a^A do?

I cant even find these on my keyboard let alone find out what they do.

PDF-writer has something similar

/usr/local/lib/ruby/gems/1.9/gems/pdf-writer-1.1.8/lib/pdf/writer.rb:712:
invalid multibyte char (US-ASCII)
/usr/local/lib/ruby/gems/1.9/gems/pdf-writer-1.1.8/lib/pdf/writer.rb:712:
syntax error, unexpected $end, expecting keyword_end
    content = "%PDF-#{@version}\n%âãÃÃ\n"

Is this hidden Japanese or something?

Thanks,
Petr
Petr J. (Guest)
on 2009-04-16 07:14
Also Transaction Simple makes this error:

no marshal_dump is defined for class Mutex

/usr/local/lib/ruby/gems/1.9/gems/transaction-simple-1.4.0/lib/transaction/simple.rb:129:in
`dump'
/usr/local/lib/ruby/gems/1.9/gems/transaction-simple-1.4.0/lib/transaction/simple.rb:129:in
`start_transaction'
/usr/local/lib/ruby/gems/1.9/gems/transaction-simple-1.4.0/lib/transaction/simple/group.rb:102:in
`block in start_transaction'
/usr/local/lib/ruby/gems/1.9/gems/transaction-simple-1.4.0/lib/transaction/simple/group.rb:102:in
`each'
/usr/local/lib/ruby/gems/1.9/gems/transaction-simple-1.4.0/lib/transaction/simple/group.rb:102:in
`start_transaction'
/usr/local/lib/ruby/gems/1.9/gems/pdf-writer-1.1.8/lib/pdf/simpletable.rb:396:in
`render_on'

ANy ideas?
Heesob P. (Guest)
on 2009-04-16 08:45
(Received via mailing list)
2009/4/16 Petr J. <removed_email_address@domain.invalid>:
> /usr/local/lib/ruby/gems/1.9/gems/gruff-0.3.4/lib/gruff/mini/legend.rb:72:
> syntax error, unexpected $end, expecting ':'
> ...ength < label.to_s.length ? "â¦" : '')
>
> This is the gruff code:
>
> truncated_label + (truncated_label.length < label.to_s.length ? "â^À¦" :
> '')
>
> What does a^A do?
>
It represents Horizontal Ellipsis "…" == "\xE2\x80\xA6" == "\u2026"


> Is this hidden Japanese or something?
>
It is just a comment to signal that the file is binary.

Refer to http://www.mactech.com/articles/mactech/Vol.15/15....

Regards,

Park H.
Petr J. (Guest)
on 2009-04-16 09:03
> It represents Horizontal Ellipsis "…" == "\xE2\x80\xA6" == "\u2026"
>
>
>> Is this hidden Japanese or something?
>>
> It is just a comment to signal that the file is binary.
>
> Refer to http://www.mactech.com/articles/mactech/Vol.15/15....
>
> Regards,
>
> Park H.

Hi,

And how do I write those if my keyboard doesnt support them?
Heesob P. (Guest)
on 2009-04-16 09:27
(Received via mailing list)
2009/4/16 Petr J. <removed_email_address@domain.invalid>:
>>
>> Park H.
>
> Hi,
>
> And how do I write those if my keyboard doesnt support them?
Write those with escape sequences.

 "\xE2\x80\xA6" and "\xE2\xE3\xCF\xD3"


Regards,

Park H.
This topic is locked and can not be replied to.