The ability to control both spin and charge degrees of freedom in semiconductor nanostructrures is at heart of spintronic and quantum information technologies. Magnetically-doped semiconductor nanowires have emerged as a promising platform for spintronics, which warrants the exploration of their synthesis, electronic structure, and magnetic properties. Here we demonstrate the preparation of manganese-doped GaN and SnO2 nanowires by chemical vapor deposition and solvothermal methods, respectively. The investigation of both systems by electron microscopy and x-ray absorption spectroscopy at ensemble and single nanowire levels indicates that manganese dopants exist in a dual oxidation state, Mn2+ and Mn3+, with Mn2+ being the majority species. X-ray magnetic circular dichroism studies of individual nanowires suggest ferromagnetic interactions of manganese dopants, and the nanowire orientation-dependent magnetization owing to the magnetocrystalline anisotropy. The results of these studies demonstrate quantitative determination of the dopant electronic structure at the molecular level, and allow for a prediction of the magnetic properties of diluted magnetic semiconductor nanowires based on their orientation and geometry.