No problem with your code with MikTeX. Look at you .log file and may be will find some clue there. By the way, if you include spanish as option for documentclass, you don't need to include in babel. And if you just use one language, don't need \selectlanguage command.
–
IgnasiNov 4 '11 at 8:34

7

Make sure that the source file is saved with the same encoding as you use for input (UTF-8 here).
–
Thorsten DonigNov 4 '11 at 8:39

5 Answers
5

You could choose another way of input encoding by the selinput package from the oberdiek bundle. It chooses the right encoding by some glyphs from your language correspondingly to the encoding of the source file.

You can also use escape codes for any accent you want to make. In general, it might be easier to fix the encoding once than have to escape every accented character, but for the occasional foreign name I use the table here http://en.wikibooks.org/wiki/LaTeX/Special_Characters.

Specifically, I would write:

!`Hola!, ?`c\'{o}mo est\'{a}s?

Do note, that with the letter i a dotless version needs to be used, as otherwise in addition to the accent, the regular i dot would be rendered.

S\'{\i}.

Note, to get the initial question mark and exclamation point, you type a backtick character immediately after.