Degree Symbol in Latex

I want to be able to simply enter the degree symbol as ° in my source code. The German keyboard has a key that makes the source more readable. I’m using pdfLaTeX from TeXLive 2012, and this minimal reproduction example:

Missing character: There is no in font cmr10!

Where there actually means that a single byte cannot form a valid UTF-8 sequence, so it cannot be printed correctly on my console.

I have a rough idea, all of them come from, but I don’t know anything about how to solve this problem. I want to make \textdegree symbols that can also work in math mode, or let the engine replace some different commands to replace my unicode code point. Ideally, the command will choose the correct form based on whether the current mode is a math mode, I do n’t know how to check (yet). For the final result, it would be nice if the symbols look the same in both text and math mode OK, so I might look for a solution that will switch to text mode to output the symbol.

But maybe there is an easier way to do it all. Maybe there is even a package. Searching through previous posts, I found that there is a package unicode-math , but this does not work for pdfLaTeX, and the switching engine does not seem to be most of my applications Reasonable requirements of the program.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{siunitx}
\begin{document}
Degree symbol in plain text works: 90\si{\degree} (or \SI{90}{\degree}) is a right angle.
Degree in math would work: $\cos(90\si{\degree}) = 0$.
\end{document}
As cgnieder said, \ang it can also be used for this purpose: