This article reviews and discusses the most relevant results achieved over recent years from the study of the electronic structure of quasicrystals (QCs) and related alloys using basically densities-of-states calculations and the x-ray emission, x-ray absorption, and photoemission spectroscopic techniques, in agreement with information obtained by other experimental means. It focuses on Al-based systems, the most widely analysed so far, and also reports data for Zr-Ni-Ti as well as Mg-based compounds. The present knowledge of QCs and approximants as compared to conventional crystals of the same phase diagrams may be summarized as follows: (i) the occurrence of a pseudogap at the Fermi level that is also present at the very surface is well established for icosahedral QCs whose formation derives from both Hume-Rothery and Al-transition metal hybridization effects; (ii) the pseudogap does not exist in the total densities of states of decagonal QCs but always exists in the Al sub-bands; (iii) states in QCs and close approximants are of more localized-like character in the vicinity of the pseudogap at the Fermi level than in conventional intermetallics, and at greater distances, above as well as below the Fermi level, they are extended-like in character, signalling a clear tendency to weak electron localization especially effective on either side of the pseudogap. As a result, there is a progressive loss of the metallic character, that can be tuned intentionally, when going from usual crystals to approximants and QCs.