Re: [go-nuts] Re: A peculiar sort problem

2021-07-28 Thread peterGo
Tobias, The C# code is likely using the string sort method: SORT_STRINGSORT. winnls.h: //STRING Sort: hyphen and apostrophe will sort with all other symbols // //co-op <--- hyphen (punctuation) //co_op <--- underscore (symbo

Re: [go-nuts] Re: A peculiar sort problem

2021-07-28 Thread Tobias Klausmann
Hi! On Tue, 27 Jul 2021, Tamás Gulácsi wrote: > First, sort all the bytes (0-255) with Go and .Net, and compare them. > For Unicode-unaware sorting, that'd be enough: create a mapping between the > two tables, > replace all the bytes in the Go's input before sort (or use a Less that > does the

Re: [go-nuts] Re: A peculiar sort problem

2021-07-28 Thread Tobias Klausmann
Hi! On Wed, 28 Jul 2021, James wrote: > It could be that .NET is using some locale based collation. Seems like a > lot of machinery, but might do the trick > https://pkg.go.dev/golang.org/x/text@v0.3.6/collate I have managed to get the .NET code used for sorting: Files.Sort((x, y) => string.Com

Re: [go-nuts] Re: A peculiar sort problem

2021-07-27 Thread James
It could be that .NET is using some locale based collation. Seems like a lot of machinery, but might do the trick https://pkg.go.dev/golang.org/x/text@v0.3.6/collate On Wed, 28 Jul 2021 at 06:52, jake...@gmail.com wrote: > Personally I would be careful about assuming that was the only sorting >