Presumably the UN intended UN/LOCODE to be used, but there doesn't seem to be any information regarding its copyright or licensing. Does anyone know under what license it's distributed?
This statement can be found on the web page: http://www.unece.org/cefact/locode/locode_since1981.html
UN/LOCODE is freely available to all interested users. It can be consulted and downloaded from the web-site www.unece.org/cefact/locode and users are welcome to propose additional locations; for this purpose a new, automated request procedure has been introduced, as described below:
Sometimes users get confused on what code lists from the UN and ISO are free to use and which are copyrighted and you need to purchase. For example, the ISO 3166-1 codes are free to use, but the ISO 3166-2 subdivision codes are not.
EDIT: Feb. 15, 2014 The ISO 3166-1 Country Codes will no longer be freely available from the ISO website after Feb. 20, 2014. You will need to purchase a subscription for 300 CHF (http://www.iso.org/iso/home/standards/country_codes/country-codes_new-product-info).
I have placed an archived version (Feb. 15, 2014) of the English and French datasets in TXT and XML format at: http://www.opengeocode.org/archive.php
For whatever it's worth now, here's how it looked to me, having no relevant affiliation or authority. But I'm glad to see now from the other answer that "UN/LOCODE is freely available to all interested users." Good.
If you need the code list for commercial or other non-personal use, I had thought for the following reasons that your procedure is to contact the UN/CEFACT secretariat at "Contact Us" for CEFACT on ECE.org.
The creation and maintenance of UN/LOCODE is authorized in Recommendation No. 16 UN/LOCODE - CODE FOR PORTS AND OTHER LOCATIONS. It states that the codes will be available, among other places, on the web. It states that one may contact the secretariat of UN/CEFACT for "conditions under which the code list may be procured."