dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.37k stars 4.75k forks source link

Erroneous leading space in ShortTimePattern and LongTimePattern in Burmese Cultures ({my} and {my-MM}) #75087

Closed vsfeedback closed 2 years ago

vsfeedback commented 2 years ago

This issue has been moved from a ticket on Developer Community.


In .Net 5 and 6 the following statements show that the ShortTimePattern and LongTimePattern properties of DateTimeInfo in the Burmese Cultures ({my} and {my-MM}) contain an erroneous leading space. In .Net 3.1 there is no space. Console.WriteLine("'"+CultureInfo.GetCultureInfo("my").DateTimeFormat.ShortTimePattern+"'"); Console.WriteLine("'"+CultureInfo.GetCultureInfo("my").DateTimeFormat.LongTimePattern+"'"); Console.WriteLine("'"+CultureInfo.GetCultureInfo("my-MM").DateTimeFormat.ShortTimePattern+"'"); Console.WriteLine("'"+CultureInfo.GetCultureInfo("my-MM").DateTimeFormat.LongTimePattern+"'");


Original Comments

Feedback Bot on 5/12/2022, 08:08 AM:

(private comment, text removed)

Feedback Bot on 9/1/2022, 03:40 AM:

(private comment, text removed)


Original Solutions

(no solutions)

ghost commented 2 years ago

Tagging subscribers to this area: @dotnet/area-system-globalization See info in area-owners.md if you want to be subscribed.

Issue Details
_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/Erroneous-leading-space-in-ShortTimePatt/10039233)._ --- In .Net 5 and 6 the following statements show that the ShortTimePattern and LongTimePattern properties of DateTimeInfo in the Burmese Cultures ({my} and {my-MM}) contain an erroneous leading space. In .Net 3.1 there is no space. Console.WriteLine("'"+CultureInfo.GetCultureInfo("my").DateTimeFormat.ShortTimePattern+"'"); Console.WriteLine("'"+CultureInfo.GetCultureInfo("my").DateTimeFormat.LongTimePattern+"'"); Console.WriteLine("'"+CultureInfo.GetCultureInfo("my-MM").DateTimeFormat.ShortTimePattern+"'"); Console.WriteLine("'"+CultureInfo.GetCultureInfo("my-MM").DateTimeFormat.LongTimePattern+"'"); --- ### Original Comments #### Feedback Bot on 5/12/2022, 08:08 AM: (private comment, text removed) #### Feedback Bot on 9/1/2022, 03:40 AM: (private comment, text removed) --- ### Original Solutions (no solutions)
Author: vsfeedback
Assignees: -
Labels: `area-System.Globalization`, `untriaged`
Milestone: -
tarekgh commented 2 years ago

I couldn't reproduce this. When running code I am getting the following result:

'H:mm'
'H:mm:ss'
'H:mm'
'H:mm:ss'

Please let's know more about your environment and how we can produce that.

tarekgh commented 2 years ago

I did some more investigation and here are some more details:

Starting from .NET 5.0, .NET started to use the ICU library instead of NLS Windows legacy APIs. The benefit here is .NET will be using the Unicode standard data and achieve consistency between different operating systems.

The current reported regarding the Burmese time format, this issue was in the ICU/CLDR. You may look at this culture data in the CLDR repo. Recently, this issue has been fixed in recent ICU version. So, it is a matter of time having Windows moves from ICU version 68 to the newer version 70. When Windows does that, the fix will be automatically applied and reflected on .NET. If the issue is a blocker for you, you may temporary consider reverting back to the old behavior using that instructions.

Let us know if you have any questions.