Comments (3)
I think this is actually a bug in Text.toLower
: Cherokee lowercase letters (e.g. U+AB82) fold to their uppercase counterparts (e.g. U+13B2). This is implemented incorrectly in text
, since the fallback case of foldMapping
in https://github.com/haskell/text/blob/master/src/Data/Text/Internal/Fusion/CaseMapping.hs converts every character to lowercase. So we get the strange (and incorrect!) behaviour that U+13B2 and U+AB82 map to each other when folding. See haskell/text#277.
from case-insensitive.
Oh, interesting: there is Data.Text.toLower
, and Data.Text.toCaseFold
. But neither is compatible with CI
:
import qualified Data.CaseInsensitive as CI
import qualified Data.Text as Text
import Prelude
main :: IO ()
main = do
print (Text.toCaseFold "\5042" == "\43906")
print ((CI.foldCase (CI.mk ("\5042" :: String))) == "\43906")
{-
*Main> :main
True
False
-}
from case-insensitive.
It gets weirder:
*Wire.API.User.RichInfo Scim Data.CaseInsensitive> foldCase ("Ꮊ" :: String)
"\43914"
*Wire.API.User.RichInfo Scim Data.CaseInsensitive> foldCase it
"\5050"
*Wire.API.User.RichInfo Scim Data.CaseInsensitive> foldCase it
"\43914"
[...]
from case-insensitive.
Related Issues (13)
- case-insensitive should have a Hashable instance HOT 3
- Doesn't build with ghc-7.2.1-rc1 HOT 2
- NoImplicitPrelude breaks GHC 6.12.1 HOT 4
- Derive SYB's Data HOT 1
- Consider moving "original" to .Unsafe HOT 3
- Build failure with GHC 7.2.2
- The repo clones awkwardly on case-insensitive filesystems HOT 2
- Binary -instance
- CI ByteString is slow HOT 5
- Cannot compile test suite in LTS 8.x HOT 1
- documentation: provide some explanation of "case folding" HOT 4
- RFC: Drop support for GHC < 8 ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from case-insensitive.