Custom alphabetical sort

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Dec 24 23:57:37 CET 2012


On Mon, 24 Dec 2012 11:18:37 -0500, Roy Smith wrote:

> In article <40d108ec-b019-4829-a969-c8ef513866f1 at googlegroups.com>,
>  Pander Musubi <pander.musubi at gmail.com> wrote:
> 
>> Hi all,
>>
>> I would like to sort according to this order:
[...]
> I'm assuming that doesn't correspond to some standard locale's collating
> order, so we really do need to roll our own encoding (and that you have
> a good reason for wanting to do this).  I'm also assuming that what I'm
> seeing as question marks are really accented characters in some encoding
> that my news reader just isn't dealing with (it seems to think your post
> was in ISO-2022-CN (Simplified Chinese).

Good lord man, what sort of crappy newsreader software are you using? (It 
claims to be "MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)" -- I think 
anything as bad as that shouldn't advertise what it is.) The OP's post 
was correctly labelled with an encoding, and not an obscure one:

Content-Type: text/plain; charset=ISO-8859-1

which if I remember correctly is Latin-1. If your newsreader can't handle 
that, surely it should default to UTF-8, which should give you the right 
results sans question marks.




-- 
Steven



More information about the Python-list mailing list