  Scattering polarization tends to dominate the linear polarization signals of
the Ca II 8542 A line in weakly magnetized areas ($B \lesssim 100$ G),
especially when the observing geometry is close to the limb. In this paper we
evaluate the degree of applicability of existing non-LTE spectral line
inversion codes (which assume that the spectral line polarization is due to the
Zeeman effect only) at inferring the magnetic field vector and, particularly,
its transverse component. To this end, we use the inversion code STiC to
extract the strength and orientation of the magnetic field from synthetic
spectropolarimetric data generated with the Hanle-RT code. The latter accounts
for the generation of polarization through scattering processes as well as the
joint actions of the Hanle and the Zeeman effects. We find that, when the
transverse component of the field is stronger than $\sim$80 G, the inversion
code is able to retrieve accurate estimates of the transverse field strength as
well as its azimuth in the plane of the sky. Below this threshold, the
scattering polarization signatures become the major contributors to the linear
polarization signals and often mislead the inversion code into severely over-
or under-estimating the field strength. Since the line-of-sight component of
the field is derived from the circular polarization signal, which is not
affected by atomic alignment, the corresponding inferences are always good.
