The Rambam (Rabbi Moshe Maimonides, 1135-1204) writes that a person who, for whatever reason, eats food that is forbidden for consumption should not recite a Beracha. If God forbade eating this food, the Rambam explains, then a Beracha recited before eating is not a blessing, but rather something contemptible. The Rambam applies this ruling to any situation of forbidden food, including food that is inherently non-kosher as well as fruits and vegetables from which the required entitlements to the Kohanim and Leviyim have not been separated. If one eats food in violation of Halacha, he does not recite a Beracha.
The Ra’avad (Rabbi Abraham Ben David of Posquieres, 1120-1198), in his critique of the Rambam’s Mishneh Torah, disagrees, and writes that the Rambam "committed a grave mistake" with regard to this Halacha. After all, the Ra’avad contended, a person who eats forbidden food derives benefit from the food, and this benefit warrants the recitation of a Beracha.
The Shulhan Aruch follows the Rambam’s position, and therefore one who, God forbid, eats forbidden food should not recite a Beracha.
This Halacha should serve as an additional warning to those who, unfortunately, eat at non-kosher restaurants and feel that they "redeem" themselves by reciting Berachot on their food. Besides the fact that they commit the grave prohibition of eating non-kosher food, any Beracha they recite constitutes a Beracha Le’batala – an unwarranted Beracha, which is also a serious transgression. We must emphasize that eating food in a non-kosher restaurant is forbidden even if he eats "only" pasta or salads. Countless Kashrut issues arise even in restaurants with Kashrut supervision, and thus certainly there is no basis whatsoever for allowing eating any food in a restaurant that does not have Kashrut certification.