Sulphur ion charge states inside solids from low-resolution K X-ray spectra