From: Peter L. <pet...@te...> - 2009-06-25 18:43:50
|
> >> Bad news. > >> > >> Ok, the bug you mention on python is not really about the same thing: > >> http://bugs.python.org/issue2481 > > > > I see that now. > > > >> I guess we best open a new bug ticket. Why do you think it is solved > >> in python 3.0? > > > > I probably put too much in the answer from Martin v. Löwis: "FWIW, this > > is fixed in Python 3.0." > > > >> I think we should do an upstream bug about different results between > >> the two procedures, and somebody should test in python 3.0 The doc > >> says strxfrm(s1) < strxfrm(s2) is equivalent to strcoll(s1, s2) < 0, > >> which is not the case on win xp. > >> You have time for an upstream bug? Anybody python 3 installed to check > >> if there fixed? > > > > I tried to find my old test case, found it and modified somewhat. > > It reads 2 small text files, one with 9 sorted strings and one with the > > same strings unsorted. I get correct result in Linux with this as it > > works for both "strcoll" and "strxfrm". > > > > It gives wrong result in WinXP for both these methods. > > In Linux locale= ('sv_SE', 'UTF8') > > while in WinXP locale= ('Swedish_Sweden', '1252') > > I have tried to set locale to "sv_SE', 'UTF8'), but failed so far. > > I'm not sure of the difference between 1252 and utf8. > > > > I have time, but I think it would be interesting to run my little test > > program in Python 3.0. > > Yes > From a bug answer on strcoll posted by Brian against python windows, I > have the impression python just calls the underlying C lib of windows > for these functions. > So we could do a bug submission with python, but the aswer will > probably be the same: windows tells us to do it that way. No reason > not to try though :-) > We could also add a comment to that windows bug as it is from 2008. It > looks strange though in that bug that he cannot make just a simple > testcase like you do in your test script. > I have tried to get my little Python script to work in WinXP, but somehow Python under win report it uses encoding 'cp1252' (Latin 1 I think). My test strings are in UTF-8, so the collating will be wrong. I have tried to change window coding to UTF-8, but without success. It's strange that the sort works in Gramps, and not in my little scipt? It works OK in Linux. I also installed Python 3 on my Win box, and after some conversion of the program I have a similar problem with 'cp1252'. I'm stuck for now. /Peter |