Home » U++ Library support » U++ Core » Strings with national specific characters are wrongly sorted - Sort
Strings with national specific characters are wrongly sorted - Sort [message #57468] |
Wed, 25 August 2021 13:01 |
|
Klugier
Messages: 1076 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
Today I found that sort returns wrong results in term of special characters:
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
Vector<WString> vec = { "Zbig", "Ąć", "Ęc", "Ala", "Edward" };
Sort(vec);
for (const auto s : vec)
{
Cout() << s << "\n";
}
}
The results are:
and should be:
This is probably corner case, because this world doesn't exist in Polish, but anyway the error is there. I believe it is more serve when these character are in the middle of the string and we have a lot of such words.
Here is the article about Polish alphabet and the order of letters.
Klugier
U++ - one framework to rule them all.
[Updated on: Wed, 25 August 2021 17:49] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Apr 17 22:48:31 CEST 2024
Total time taken to generate the page: 0.01587 seconds
|