# Sort and localization

**URL:** <https://rubytalk.org/t/sort-and-localization/53258>\
**Category:** ruby-talk\
**Created:** [6 May 2009 20:50 UTC](https://rubytalk.org/t/sort-and-localization/53258 "2009-05-06T20:50:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giampiero\_Zanchi](https://avatars.discourse-cdn.com/v4/letter/g/7c8e57/32.png) [@Giampiero\_Zanchi](https://rubytalk.org/u/Giampiero_Zanchi)\
**Post date:** [6 May 2009 20:50 UTC](https://rubytalk.org/t/sort-and-localization/53258/1 "2009-05-06T20:50:32Z")

</div>

Hi to all  
I'm trying to solve projecteuler problem 022  
([http://projecteuler.net/index.php?section=problems&id=22](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?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Greg\_Brown1](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@Greg\_Brown1](https://rubytalk.org/u/Greg_Brown1)\
**Post date:** [6 May 2009 22:16 UTC](https://rubytalk.org/t/sort-and-localization/53258/2 "2009-05-06T22:16:40Z")

</div>

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

> **···**
>
> 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  
> > ([Archived Problems - Project Euler](http://projecteuler.net/index.php?section=problems&id=22%5C)) 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?
