diff options
| author | Kenneth Reitz <me@kennethreitz.com> | 2010-10-06 13:42:52 -0400 |
|---|---|---|
| committer | Kenneth Reitz <me@kennethreitz.com> | 2010-10-06 13:42:52 -0400 |
| commit | 96c93871cf1e8f047b6656912636cc638f2a1808 (patch) | |
| tree | 877c6e814b2ef0e5670b52121c5f79d709021e77 /tablib/packages/xlwt/examples/unicode0.py | |
| parent | a54949bc08e7323bb7b276d8b8acd7ab0ec5a397 (diff) | |
| download | tablib-96c93871cf1e8f047b6656912636cc638f2a1808.tar.gz | |
Vendorized XLWT.
Diffstat (limited to 'tablib/packages/xlwt/examples/unicode0.py')
| -rw-r--r-- | tablib/packages/xlwt/examples/unicode0.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tablib/packages/xlwt/examples/unicode0.py b/tablib/packages/xlwt/examples/unicode0.py new file mode 100644 index 0000000..3651ec9 --- /dev/null +++ b/tablib/packages/xlwt/examples/unicode0.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python +import xlwt + +# Strings passed to (for example) Worksheet.write can be unicode objects, +# or str (8-bit) objects, which are then decoded into unicode. +# The encoding to be used defaults to 'ascii'. This can be overridden +# when the Workbook instance is created: + +book = xlwt.Workbook(encoding='cp1251') +sheet = book.add_sheet('cp1251-demo') +sheet.write(0, 0, '\xce\xeb\xff') +book.save('unicode0.xls') |
