Countermeasures against XSS with UTF-7 are:
- Specify charset clearly (HTTP header is recommended)
- Don't place the text attacker can control before <meta>
- Specify recognizable charset name by browser.
For more information about UTF-7 trick, see "
Cross-site scripthing with UTF-7".