Open yasinarik opened 4 years ago
Hm. This may be a dart bug... here's some tests in dartpad..
void main() {
print('İ => ${'İ'.toLowerCase()} => ${'İ'.toLowerCase().toUpperCase()}');
print('${'İ'.codeUnits} => ${'İ'.toLowerCase().codeUnits} => ${'İ'.toLowerCase().toUpperCase().codeUnits}');
}
İ => i̇ => İ
[304] => [105, 775] => [73, 775]
Normally, I wouldn't blame the base language...but I'm not sure what else to think.
Also strange, if you look at the output here in the github, the re-uppercase looks fine... but in dartpad, the dot is offset.
I may play around with it some more.. can you send me an example string that you're seeing the issue with?
It looks like it's breaking up the character into two code...but then just uppercasing the first half of the code (73 = 'I')
can you send me an example string that you're seeing the issue with?
Sure! Here you are :) Also thanks for the very quick reply!
"insan".titleCase
--> "Insan"
. It must be "İnsan"
"Siparişler".toUpperCase()
--> "SIPARIŞLAR"
. However it must be "SİPARİŞLER"
@nitehogg EDIT: Well, actually this is a very particular case that happens in Turkish (and maybe some other langs.) I mean if the text is in English, ReCase works as expected since there is not the upper case "i"
in English. However, the Turkish Language has both "ı" , "i" , "I" , "İ"
.
The logic here should be that ReCase may be added with exceptional situations of different languages. For example ReCase(text, langCode).titleCase
Maybe this can be leveraged with the Characters
package?
@mateusfccp I was thinking the same thing. I'm going to give it a try sometime this week.
.titleCase
changesi
toI
instead ofİ
Can you provide a quick fix?I have tried with
ş ç ğ ü ö
They becomeŞ Ç Ğ Ü Ö
so no problem.THANKS for this great package ☺️