[Ann] .Net Core 2.0 globalisation mode
От: Sinix  
Дата: 18.07.17 20:37
Оценка: 4 (1) :)
Сабж.

.NET Core 2.0 includes a new opt-in globalization mode that provides basic globalization-related functionality that is uniform across operating systems and languages. The benefit of this new mode is its uniformity, distribution size, and the absence of any globalization dependencies. The downside is that it doesn't actually provide globalization functionality.


Решение абсолютно гениальное в своей элегантности и чем-то напоминает цветовую палитру от Генри Форда. Один маленький свитч полностью убирает все проблемы с локализацией приложения.
  Скучные подробности

When enabling the invariant mode, all cultures behave like the invariant culture. The invariant culture has the following characteristics:
* Culture names (English, native display, ISO, language names) will return invariant names. For instance, when requesting culture native name, you will get "Invariant Language (Invariant Country)".
* All cultures LCID will have value 0x1000 (which means Custom Locale ID). The exception is the invariant cultures which will still have 0x7F.
* All Date/Time formatting and parsing will use fixed date and time patterns. For example, the short date will be "MM/dd/yyyy" regardless of the culture used. Applications having old formatted date/time strings may not be able to parse such strings without using ParseExact.
* Numbers will always be formatted as the invariant culture. For example, decimal point will always be formatted as ".". Number strings previously formatted with cultures that have different symbols will fail parsing.
* All cultures will have currency symbol as "¤"
* Culture enumeration will always return a list with one culture which is the invariant culture.

...

String casing (ToUpper and ToLower) will be performed for the ASCII range only. Requests to case code points outside that range will not be performed, however no exception will be thrown. In other words, casing will only be performed for character range ['a'..'z'].

...
* IDN support doesn't conform to the latest standard.
* IDN support will be incorrect if the input IDN string is not normalized since normalization is not supported in invariant mode.
* Some basic IDN strings will still produce correct values.

(с)


Надо будет предложить аналогичные switch для устранения принципиальных недостатков floating point math (все значения ведут себя как целые) а также для упрощения многопоточного программирования (при дедлоке оба потока получают блокировку). Если есть ещё идеи — не стесняемся, подкидываем
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.