  We study the Hausdorff dimension and measures of full Hausdorff dimension for
a compact invariant set of an expanding nonconformal map on the torus given by
an integer-valued diagonal matrix. The Hausdorff dimension of a "general
Sierpinski carpet" was found by McMullen and Bedford and the uniqueness of the
measure of full Hausdorff dimension in some cases was proved by Kenyon and
Peres. We extend these results by using compensation functions to study a
general Sierpinski carpet represented by a shift of finite type. We give some
conditions under which a general Sierpinski carpet has a unique measure of full
Hausdorff dimension, and study the properties of the unique measure.
