UnicodeEncodeError with xlrd

I'm trying to read a .xlsx with xlrd. I have everything set up and working. It works for data with normal English letters as well as numbers. However when it gets to Swedish letters (ÄÖÅ) it gives me this error:

print str(sheet.cell_value(1, 2)) + " " + str(sheet.cell_value(1, 3)) + " " + str(sheet.cell_value(1, 4)) + " " + str(sheet.cell_value(1, 5))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xd6' in position 1: ordinal not in range(128)

My code:

# -*- coding: cp1252 -*-
import xlrd

file_location = "test.xlsx"

workbook = xlrd.open_workbook(file_location)
sheet = workbook.sheet_by_index(0)

print str(sheet.cell_value(1, 2)) + " " + str(sheet.cell_value(1, 3)) + " " + str(sheet.cell_value(1, 4)) + " " + str(sheet.cell_value(1, 5))

I've even tried:

workbook = xlrd.open_workbook("test.xlsx", encoding_override="utf-8")

as well as:

workbook = xlrd.open_workbook("test.xlsx", encoding="utf-8")

Edit: I'm running Python 2.7 on a Windows 7 64-bit computer.


'ascii' codec can't encode

The problem here isn't the decode when reading the file, it is the encode necessary to print. Your environment is using ASCII for sys.stdout, and so when you try to print any Unicode characters that can't be encoded in ASCII you'll receive that error.

Documentation reference:

The character encoding is platform-dependent. Under Windows, if the stream is interactive (that is, if its isatty() method returns True), the console codepage is used, otherwise the ANSI code page. Under other platforms, the locale encoding is used (see locale.getpreferredencoding()).

Under all platforms though, you can override this value by setting the PYTHONIOENCODING environment variable before starting Python.