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
[x ] Bug
[ ] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement
Expected Behavior
When instantiating a new Contact, the library should not check the ISO 3166-1 (two letters) code with CultureInfo.GetCulture() because this list is incomplete.
Current Behavior
The library throws a SwissQrCodeContactException.
Possible Solution (optional)
Class: PayloadGenerator. Private constructor for Contact.
Please remove the following lines of code: if (!((IEnumerable<CultureInfo>) CultureInfo.GetCultures(CultureTypes.SpecificCultures)).Where<CultureInfo>((Func<CultureInfo, bool>) (x => new RegionInfo(x.LCID).TwoLetterISORegionName.ToUpper() == country.ToUpper())).Any<CultureInfo>()) throw new PayloadGenerator.SwissQrCode.Contact.SwissQrCodeContactException("Country must be a valid \"two letter\" country code as defined by ISO 3166-1, but it isn't.");
Steps to Reproduce (for bugs)
Instantiate a Contact with the Two-letter-code "GH" for Ghana (parameter: "country"), which is an official ISO 3166-1 code but missing in CultureInfo.GetCultures() from .Net Framework
Your Environment
Not relevant
The text was updated successfully, but these errors were encountered:
This is fixed in 7e6cc92 Since .NET still doesn't bring a complete list/all-in-one solution for the ISO codes, I decided to add an external solution. If you disagree with the code changes, feel free to re-open the issue. :-)
Type of issue
[x ] Bug
[ ] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement
Expected Behavior
When instantiating a new Contact, the library should not check the ISO 3166-1 (two letters) code with CultureInfo.GetCulture() because this list is incomplete.
Current Behavior
The library throws a SwissQrCodeContactException.
Possible Solution (optional)
Class: PayloadGenerator. Private constructor for Contact.
Please remove the following lines of code:
if (!((IEnumerable<CultureInfo>) CultureInfo.GetCultures(CultureTypes.SpecificCultures)).Where<CultureInfo>((Func<CultureInfo, bool>) (x => new RegionInfo(x.LCID).TwoLetterISORegionName.ToUpper() == country.ToUpper())).Any<CultureInfo>()) throw new PayloadGenerator.SwissQrCode.Contact.SwissQrCodeContactException("Country must be a valid \"two letter\" country code as defined by ISO 3166-1, but it isn't.");
Steps to Reproduce (for bugs)
Instantiate a Contact with the Two-letter-code "GH" for Ghana (parameter: "country"), which is an official ISO 3166-1 code but missing in CultureInfo.GetCultures() from .Net Framework
Your Environment
Not relevant
The text was updated successfully, but these errors were encountered: