You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to reproduce the issue
use Net Core 2.1 and Display StandardName and DisplayName on Windows os
use Net Core 3.1 and Display StandardName and DisplayName on Linux os
Expected behavior
We expect that the StandardNamas and DisplayNames to be the same from 2.1 to 3.1
Actual behavior
It seams that the behavior has changed from 2.1 to 3.1 on Linux os, the DisplayName is replaced by StandardName and vice versa.
Result in NET Core 2.2 Windows and Linux- using Docker:
FROM nosinovacao/dotnet-sonar:19.09.0 as build
The results are the same for both OS
{
"displayName": "((UTC-12:00) International Date Line West) Dateline Standard Time"
},
{
"displayName": "((UTC-11:00) Co-ordinated Universal Time-11) UTC-11"
},
{
"displayName": "((UTC-10:00) Aleutian Islands) Aleutian Standard Time"
},
{
"displayName": "((UTC-10:00) Hawaii) Hawaiian Standard Time"
},
{
"displayName": "((UTC-09:30) Marquesas Islands) Marquesas Standard Time"
},
{
"displayName": "((UTC-09:00) Alaska) Alaskan Standard Time"
},
{
"displayName": "((UTC-09:00) Co-ordinated Universal Time-09) UTC-09"
},
{
"displayName": "((UTC-08:00) Baja California) Pacific Standard Time (Mexico)"
},
{
"displayName": "((UTC-08:00) Co-ordinated Universal Time-08) UTC-08"
} Same code, after upgrade to 3.1
Using FROM nosinovacao/dotnet-sonar:latest as build
Results are different on Windows vs Linux
Results for Windows:
{
"displayName": "((UTC-12:00) International Date Line West) Dateline Standard Time"
},
{
"displayName": "((UTC-11:00) Co-ordinated Universal Time-11) UTC-11"
},
{
"displayName": "((UTC-10:00) Aleutian Islands) Aleutian Standard Time"
},
{
"displayName": "((UTC-10:00) Hawaii) Hawaiian Standard Time"
},
{
"displayName": "((UTC-09:30) Marquesas Islands) Marquesas Standard Time"
},
{
"displayName": "((UTC-09:00) Alaska) Alaskan Standard Time"
},
{
"displayName": "((UTC-09:00) Co-ordinated Universal Time-09) UTC-09"
},
{
"displayName": "((UTC-08:00) Baja California) Pacific Standard Time (Mexico)"
},
{
"displayName": "((UTC-08:00) Co-ordinated Universal Time-08) UTC-08"
} Results from the Docker image(Linux):
{
"displayName": "(Dateline Standard Time) Dateline Standard Time"
},
{
"displayName": "(UTC-11) UTC-11"
},
{
"displayName": "(Aleutian Standard Time) Aleutian Standard Time"
},
{
"displayName": "(Hawaiian Standard Time) Hawaiian Standard Time"
},
{
"displayName": "(Marquesas Standard Time) Marquesas Standard Time"
},
{
"displayName": "(Alaskan Standard Time) Alaskan Standard Time"
},
{
"displayName": "(UTC-09) UTC-09"
},
{
"displayName": "(Pacific Standard Time (Mexico)) Pacific Standard Time (Mexico)"
},
{
"displayName": "(UTC-08) UTC-08"
},
Why need to have the standard name match the display name? the display name is intended to be used for display purposes and shouldn't assume will change or match the standard names.
@cristina-dorotan could you please clarify your scenario and why you need to have the 2 names match? Also, you shouldn't take any dependency on the display name as it can change and possibly can be displayed in different languages (even we don't support that today).
@cristina-dorotan I am closing this issue but feel free to respond back with any question or request and we'll be happy to assist you and reactivate if necessary.
I am seeing some weird things. I have a full Ubuntu 18.04 VM and I am not able to repro the issue on it. But, on my WSL2 with Ubuntu 18.04, I am seeing the names are wrong. I'll look more into that to figure out what is wrong.
CC @eerhardt who guessed correctly what could be the issue.
@cristina-dorotan although the issue is not a direct regression in TimeZoneInfo, it is a side effect of the change dotnet/coreclr#25373 which avoid using the C or POSIX locales. What is happening is we use CultureInfo.CurrentUICulture to get the names of the Time Zones from the ICU library. I believe you have the LANG setting in your machine set to C.UTF-8 which is translated to en-US_posix locale in 2.x version and that locale used to work with ICU to get the nice names. In 3.1 we are mapping this POSIX locale to invariant which ICU not returning the nice names using this locale. By the way, this issue can repro on 2.1 if setting the UI culture to invariant.
You have 2 easy options to work around this problem:
1- either set the language to something different than C locale. do something like: export LANG=en_US.UTF-8 and then run your app. Or
2- you can do this in the code before getting the names. something like the following:
if(CultureInfo.CurrentUICulture.Name.Length==0){CultureInfo.CurrentUICulture=CultureInfo.GetCultureInfo("en-US");TimeZoneInfo.ClearCachedData();}// get the time zone names
@danmosemsft we'll try to have some nicer solution for this issue in 5.0 but the question is, do we need to service this in 3.1? we already have a simple workaround if needed.
@danmosemsft we'll try to have some nicer solution for this issue in 5.0 but the question is, do we need to service this in 3.1? we already have a simple workaround if needed.
3.1 is an LTS release. To service we need a combination of significant/widespread customer impact and acceptably low risk. This sounds like mainly a display issue and with a good workaround. So it does not seem a servicing candidate.
Activity
danmoseley commentedon Mar 2, 2020
Can you give concrete examples? (Code and output before/after)
cristina-dorotan commentedon Mar 3, 2020
Result in NET Core 2.2 Windows and Linux- using Docker:
FROM nosinovacao/dotnet-sonar:19.09.0 as build
The results are the same for both OS
{
"displayName": "((UTC-12:00) International Date Line West) Dateline Standard Time"
},
{
"displayName": "((UTC-11:00) Co-ordinated Universal Time-11) UTC-11"
},
{
"displayName": "((UTC-10:00) Aleutian Islands) Aleutian Standard Time"
},
{
"displayName": "((UTC-10:00) Hawaii) Hawaiian Standard Time"
},
{
"displayName": "((UTC-09:30) Marquesas Islands) Marquesas Standard Time"
},
{
"displayName": "((UTC-09:00) Alaska) Alaskan Standard Time"
},
{
"displayName": "((UTC-09:00) Co-ordinated Universal Time-09) UTC-09"
},
{
"displayName": "((UTC-08:00) Baja California) Pacific Standard Time (Mexico)"
},
{
"displayName": "((UTC-08:00) Co-ordinated Universal Time-08) UTC-08"
}
Same code, after upgrade to 3.1
Using FROM nosinovacao/dotnet-sonar:latest as build
Results are different on Windows vs Linux
Results for Windows:
{
"displayName": "((UTC-12:00) International Date Line West) Dateline Standard Time"
},
{
"displayName": "((UTC-11:00) Co-ordinated Universal Time-11) UTC-11"
},
{
"displayName": "((UTC-10:00) Aleutian Islands) Aleutian Standard Time"
},
{
"displayName": "((UTC-10:00) Hawaii) Hawaiian Standard Time"
},
{
"displayName": "((UTC-09:30) Marquesas Islands) Marquesas Standard Time"
},
{
"displayName": "((UTC-09:00) Alaska) Alaskan Standard Time"
},
{
"displayName": "((UTC-09:00) Co-ordinated Universal Time-09) UTC-09"
},
{
"displayName": "((UTC-08:00) Baja California) Pacific Standard Time (Mexico)"
},
{
"displayName": "((UTC-08:00) Co-ordinated Universal Time-08) UTC-08"
}
Results from the Docker image(Linux):
{
"displayName": "(Dateline Standard Time) Dateline Standard Time"
},
{
"displayName": "(UTC-11) UTC-11"
},
{
"displayName": "(Aleutian Standard Time) Aleutian Standard Time"
},
{
"displayName": "(Hawaiian Standard Time) Hawaiian Standard Time"
},
{
"displayName": "(Marquesas Standard Time) Marquesas Standard Time"
},
{
"displayName": "(Alaskan Standard Time) Alaskan Standard Time"
},
{
"displayName": "(UTC-09) UTC-09"
},
{
"displayName": "(Pacific Standard Time (Mexico)) Pacific Standard Time (Mexico)"
},
{
"displayName": "(UTC-08) UTC-08"
},
danmoseley commentedon Mar 4, 2020
@tarekgh is this familiar?
tarekgh commentedon Mar 4, 2020
This was intentional change 0663f87
Why need to have the standard name match the display name? the display name is intended to be used for display purposes and shouldn't assume will change or match the standard names.
@cristina-dorotan could you please clarify your scenario and why you need to have the 2 names match? Also, you shouldn't take any dependency on the display name as it can change and possibly can be displayed in different languages (even we don't support that today).
tarekgh commentedon Mar 4, 2020
@cristina-dorotan I am closing this issue but feel free to respond back with any question or request and we'll be happy to assist you and reactivate if necessary.
cristina-dorotan commentedon Mar 5, 2020
@tarekgh @danmosemsft
I opened the ticket because they are mixed up in Linux, NOT because StandardName is not equal with DisplayName.
I am saying that StandardName in Windows != StandardName in Linux and
This happens after the upgrade, as I mentioned before we are using nosinovacao/dotnet-sonar:latest as build.
I would expect them to be the same in different Operating Systems as they were before the upgrade.
tarekgh commentedon Mar 6, 2020
Thanks @cristina-dorotan for the clarification.
I am seeing some weird things. I have a full Ubuntu 18.04 VM and I am not able to repro the issue on it. But, on my WSL2 with Ubuntu 18.04, I am seeing the names are wrong. I'll look more into that to figure out what is wrong.
tarekgh commentedon Mar 6, 2020
CC @eerhardt who guessed correctly what could be the issue.
@cristina-dorotan although the issue is not a direct regression in TimeZoneInfo, it is a side effect of the change dotnet/coreclr#25373 which avoid using the
CorPOSIXlocales. What is happening is we use CultureInfo.CurrentUICulture to get the names of the Time Zones from the ICU library. I believe you have the LANG setting in your machine set toC.UTF-8which is translated to en-US_posix locale in 2.x version and that locale used to work with ICU to get the nice names. In 3.1 we are mapping this POSIX locale to invariant which ICU not returning the nice names using this locale. By the way, this issue can repro on 2.1 if setting the UI culture to invariant.You have 2 easy options to work around this problem:
1- either set the language to something different than
Clocale. do something like:export LANG=en_US.UTF-8and then run your app. Or2- you can do this in the code before getting the names. something like the following:
@danmosemsft we'll try to have some nicer solution for this issue in 5.0 but the question is, do we need to service this in 3.1? we already have a simple workaround if needed.
danmoseley commentedon Mar 6, 2020
3.1 is an LTS release. To service we need a combination of significant/widespread customer impact and acceptably low risk. This sounds like mainly a display issue and with a good workaround. So it does not seem a servicing candidate.