Forum: Ruby sort and localization

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.
Giampiero Z. (Guest)
on 2009-05-07 00:50
Hi to all
I'm trying to solve projecteuler problem 022
(http://projecteuler.net/index.php?section=problems&id=22) but with no
success. I suspect it may depend on localization of ruby sort (???). So
my question is: may ruby sort change due to the localization of the
machine it is running on?
Gregory B. (Guest)
on 2009-05-07 02:17
(Received via mailing list)
On Wed, May 6, 2009 at 4:50 PM, Giampiero Z. 
<removed_email_address@domain.invalid> wrote:
> Hi to all
> I'm trying to solve projecteuler problem 022
> (http://projecteuler.net/index.php?section=problems&id=22) but with no
> success. I suspect it may depend on localization of ruby sort (???). So
> my question is: may ruby sort change due to the localization of the
> machine it is running on?

Sort is done by ASCII sort order on Ruby 1.8.   Not sure on Ruby 1.9,
but my guess is that it does not assume anything about 'alphabetical
order', but uses character codes instead.  (Causing the same problem)

-greg
Giampiero Z. (Guest)
on 2009-05-07 11:09
Hi Gregory
I will try to build a custom sort on array string
thanks for your kind reply
Giampiero
This topic is locked and can not be replied to.