New electron density diagnostic line ratios are presented for the O iv 2s22p 2P–2s2p24P and S iv 3s23p 2P–3s3p24P intercombination lines around 1400Å. A comparison of these with observational data for the symbiotic star RR Telescopii (RR Tel), obtained with the Space Telescope Imaging Spectrograph (STIS), reveals generally very good agreement between theory and observation. However the S iv2P3/2–4P1/2 transition at 1423.824Å is found to be blended with an unknown feature at 1423.774 Å. The linewidth for the latter indicates that the feature arises from a species with a large ionization potential. In addition, the S iv2P1/2–4P3/2 transition at 1398.044 Å is identified for the first time (to our knowledge) in an astrophysical source other than the Sun, and an improved wavelength of 1397.166 Å is measured for the O iv2P1/2–4P3/2 line. The O iv and S iv line ratios in a sunspot plume spectrum, obtained with the Solar Ultraviolet Measurements of the Emitted Radiation (SUMER) instrument on the Solar and Heliospheric Observatory, are found to be consistent, and remove discrepancies noted in previous comparisons of these two ions.