[composer] Correctly handle encoded HTML source (fix #11287)