-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String.StartsWith/EndsWith/IndexOf/LastIndexOf ignoring null characters on Unix #4673
Comments
Baseline tests against dotnet/coreclr#2051
@tarekgh would you mind taking a look at this? |
I believe this is by design in Linux as Linux ignore the null characters. i.e. null characters has no weights for the string comparison. if someone want to to have accurate result should use ordinal comparisons and not linguistic comparison. I understand this is different than Windows but we already have some differences between Windows and Linux in this space. |
Closing per @tarekgh's comments |
Disabled test, reopen it. |
@AlexGhiondea I have marked this as a test issue and moved it to the future. please change it back if you think otherwise. |
@tarekgh Can this be closed? I confirmed that the null character is a weightless character in ICU. auto status = UErrorCode{};
UCollator* collator = ucol_open("", &status);
uint8_t sortKey[64];
auto result = ucol_getSortKey(
collator,
(UChar*)L"ab\0cd",
5,
sortKey,
sizeof(sortKey));
result = ucol_getSortKey(
collator,
(UChar*)L"abcd",
4,
sortKey,
sizeof(sortKey)); The two calls above will return the same value for |
@GrabYourPitchforks I am closing it. I assume there is no test failing because of that today. |
There are still some tests disabled against this issue (with coreclr URL).
|
For example, this:
prints out true.
The text was updated successfully, but these errors were encountered: