Skip to content

Issue with generation for Address within Kosovo #420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hellmer1234 opened this issue Sep 27, 2022 · 2 comments · Fixed by #497
Closed

Issue with generation for Address within Kosovo #420

hellmer1234 opened this issue Sep 27, 2022 · 2 comments · Fixed by #497
Labels

Comments

@hellmer1234
Copy link

Type of issue

[ X ] Bug
[ ] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement

Expected Behavior

When i put XK as country code within a contact address, i could generate a valid swissQRCode
as XK is a valid ISO 3166-1 alpha-2 code for Kosovo (https://laendercode.net/fr/country/xk)

Current Behavior

When trying to use XK as country code, i encounter the following error :
Country must be a valid "two letter" country code as defined by ISO 3166-1, but it isn't.
Stacktrace: at QRCoder.PayloadGenerator.SwissQrCode.Contact..ctor(String name, String zipCode, String city, String country, String streetOrAddressline1, String houseNumberOrAddressline2, AddressType addressType)

Possible Solution (optional)

In private static HashSet ValidTwoLetterCodes() add the ISO-3166-1 code for Kosovo (as describe here :https://laendercode.net/fr/country/xk)

Steps to Reproduce (for bugs)

When trying the following strings in the payload, i encounter an error :

  • Country : XK

Your Environment

  • Compiled from source or NuGet package?: Nuget Package
  • Version used : QRCoder 1.3.9
@codebude codebude added the bug label Jun 14, 2023
@codebude
Copy link
Owner

codebude commented Jun 14, 2023

XK is not part of the list, since it isn't part of the official ISO standard as far as I can see. Check it out here: https://www.iso.org/obp/ui/#search/code/

The SwissQRCode standard in addition says that the country code must be ISO-3166-1 compliant. So technically my implementation is correct. Nevertheless I see the need and I also saw, that most organizations agreed on using XK as long as there is no official code, so I'll add it to the list soon.

@hellmer1234
Copy link
Author

Many thanks for all the job @codebude
Tested and deployed into production.
Well done !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants