Sort and localization


#1

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?


#2

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


#3

Hi Gregory
I will try to build a custom sort on array string
thanks for your kind reply
Giampiero