Fix #15550 by quoting RULE names during TH conversion