-
Notifications
You must be signed in to change notification settings - Fork 33
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
System.OsPath.Data.ByteString.Short.Word16.isInfixOf
looks dodgy
#195
Comments
Hi, windows is not really UTF-16, but UCS-2. Windows does not enforce well formed surrogate pairs (as in: it accepts any sequence of WCHARs). Does that answer your question? |
Not really. What I'm saying is that while you can of course use e.g. If you use Example:
That's why I was surprised to see that So my question still remains: Is this an oversight, or is there some rational behind this. |
Yeah, I think you're right. We have to respect Word16 boundaries. |
Ok, two more observations:
So yes, this needs to be fixed, but the impact is very likely low. |
I think consequently, |
Yes, exactly. From when I checked last time, I think only those two are problematic. |
@Bodigrim I'm not too familiar with the Do you have advice? I tried using a proper definition of |
You can run |
This is released in https://hackage.haskell.org/package/filepath-1.4.100.4 commit 367f6bf |
I haven't tried anything, but from reading the code, it looks like this is just a re-export from
bytestring
. Consequently, I think it can yield false positives if you were to use it for substring matching of UTF-16.Is this by intention?
The text was updated successfully, but these errors were encountered: