Let X, Y be topologically mixing subshifts of finite type and \pi : X \rightarrow Y a factor map. For each \alpha \geq 0, the weighted entropy function \phi_{\alpha} is defined by \phi_{\alpha} (\mu) = h (\mu) + \alpha h (\pi \mu) for each invariant measure \mu on X. To investigate whether for a given \alpha > 0 there is a unique measure which achieves \sup_{\mu} \phi_{\alpha} (\mu), we use the concept of compensation functions which was first considered by Boyle and Tuncel and has been developed by Walters. We prove that if there is a certain kind (more general than summable variation) of compensation function, then for each \alpha \geq 0 the shift-invariant measure which maximizes the weighted entropy is unique. In particular, if the compensation function is locally constant, then the unique measure is Markov and mixing. We classify the 1-block codes from a 3-symbol subshift of finite type to a 2-symbol subshift in terms of what type of compensation function exists or does not exist, providing examples of factor maps which do and do not satisfy the hypothesis. Also we study general properties of compensation functions and the maximal weighted entropy map as a function of the weight.