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.
64aa4b69fdd7127e6f3ee16ae065a620?d=identicon&s=25 Giampiero Zanchi (giampiz)
on 2009-05-06 22: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?
31e038e4e9330f6c75ccfd1fca8010ee?d=identicon&s=25 Gregory Brown (Guest)
on 2009-05-07 00:17
(Received via mailing list)
On Wed, May 6, 2009 at 4:50 PM, Giampiero Zanchi <cidza@tin.it> 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
64aa4b69fdd7127e6f3ee16ae065a620?d=identicon&s=25 Giampiero Zanchi (giampiz)
on 2009-05-07 09: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.