I have an automatically-generated XML file that is supposed to be encoded with UTF-8. For the most part, the encoding is correct. However, there are some few characters that are not encoded properly. When viewing the file in Emacs, I get \370, \351.
Is there a way to detect their characters programatically? I prefer solutions using PHP, but solutions in Perl or Java would be very helpful as well.