Open sowacx opened 2 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger See info in area-owners.md if you want to be subscribed.
Tagging subscribers to this area: @dotnet/area-system-globalization See info in area-owners.md if you want to be subscribed.
CC @ilonatommy @matouskozak
@sowacx thank you for this issue and the comparison with Kotlin. This is something we need to investigate and reconsider if there is a possibility for us to get the necessary culture information from Android ICU.
Description
Hello,
There is long story with Turkish 'ı' and 'i'. Many details can be found here: http://www.i18nguy.com/unicode/turkish-i18n.html Long story short - With Turkish locale ToUpper should transform text in this way: i -> İ (dotted i) ı -> I (dottless ı)
For investigation I am using phrase 'Anlıyorum bilgi edinin iİ'. Transformation TpUpper should give result 'ANLIYORUM BİLGİ EDİNİN İİ', but MAUI on Android platform is 'ANLIYORUM BILGI EDININ Iİ'
It's working fine with plain .NET8 console app, proof: https://dotnetfiddle.net/fIV4eQ
I found two issues reported at dotnet / runtime project that are describing that issue. Both were closed with comments that were pointing that root cause is Android ICU and dotnet familly can not do much about it. https://github.com/dotnet/runtime/issues/77689 https://github.com/dotnet/runtime/issues/102622
But I started to dig a bit deeper. I found out that when I run Kotlin project with Android studio everything is fine. I forked some github project that is setting Locale to specific language. When I set 'en' it is giving me 'ANLIYORUM BILGI EDININ Iİ', but then setting 'tr' locale produces 'ANLIYORUM BİLGİ EDİNİN İİ'. Everything is proper at here. So why it's not with MAUI Android? Repository for my forked Kotlin project: https://github.com/sowacx/WizardOfLocale-maui-investigation
Then I tried to call setLocale the same way as in Kotlin App. That is possible by overriding MainActivity method AttachBaseContext. Code looks like that:
Additionally I set up Cultures to 'tr-TR' at MauiApplication c'tor. But that all did not fix problem.
My MAUI project to reproduce: https://github.com/sowacx/maui-turkish-locale-issue
Steps to Reproduce
<Label Text="Anlıyorum bilgi edinin iİ" TextTransform="Uppercase" Style="{StaticResource Headline}" SemanticProperties.HeadingLevel="Level1" />
Link to public reproduction project repository
https://github.com/sowacx/maui-turkish-locale-issue
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 14
Did you find any workaround?
Unfortunately no
Relevant log output
No response