tests/test-qapi-introspect.c tests/test-qapi-introspect.h: \
 tests/test-qapi-gen-timestamp ;
 tests/test-qapi-gen-timestamp: $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(qapi-py)
-       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
+       $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-gen.py \
                -o tests -p "test-" $<, \
                "GEN","$(@:%-timestamp=%)")
        @>$@
 
 tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(qapi-py)
-       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
+       $(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-gen.py \
                -o tests/qapi-schema -p "doc-good-" $<, \
                "GEN","$@")
        @mv tests/qapi-schema/doc-good-qapi-doc.texi $@
 .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y))
 $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
        $(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
-               $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py \
+               $(PYTHON_UTF8) $(SRC_PATH)/tests/qapi-schema/test-qapi.py \
                $^ >$*.test.out 2>$*.test.err; \
                echo $$? >$*.test.exit, \
                "TEST","$*.out")