Pragmatic Unicode, or, How do I stop the pain?

A session at PyCon US 2012

Saturday 10th March, 2012

11:45am to 12:15pm (PST)

Python has great Unicode support, but it's still your responsibility to handle it properly. I'll do a quick overview of what Unicode is, but only enough to get your program working properly. I'll describe strategies to make your code work, and keep it working, without getting too far afield in Unicode la-la-land.

Python has great Unicode support, but it's still your responsibility to handle it properly. Even expert programmers get tripped up with the encodings and decodings that can happen implicitly, throwing errors in unexpected places.

This talk will present a quick overview of what Unicode is, why it exists, and how it works, but only enough to get your program working properly. Unicode can be intricate and fascinating, but really, who cares? You just want your code to work without throwing a UnicodeEncodeError every time an accented character sneaks in somehow.

I'll describe strategies to make your code work, and keep it working, without getting too far afield in Unicode la-la-land.

How Unicode is handled is one of the biggest changes in Python 3. I'll touch on what those changes are, and how you can use them to keep even your Python 2 code running smoothly.

Outline
Bytes vs. text
ASCII, 8859-1, etc.
Unicode
Encodings
Python 2: str vs unicode
encode and decode
implicit conversions!!
Python 3: bytes vs str
Everybody's happy!

About the speaker

This person is speaking at this event.
Ned Batchelder

Next session in E3

1:20pm A Gentle Introduction to GIS by Jason Scheirer

Coverage of this session

Sign in to add slides, notes or videos to this session

Tell your friends!

When

Time 11:45am12:15pm PST

Date Sat 10th March 2012

Short URL

lanyrd.com/spccy

Official session page

us.pycon.org/…e/presentation/141/

View the schedule

Share

Topics

See something wrong?

Report an issue with this session