andymccurdy/redis-py — Issue #222: PythonParser and HiredisParser don't use connection encoding kwarg
Author: fdintino
Created: 2012-02-08 20:59:22+00:00
State: open

Given the following code:

```python
client = redis.Redis(host='localhost', charset='utf-8')
client.set('copyright-string', u'Copyright \xa9 2012')
cached_val = client.get('copyright-string')
print 'type=%s' % type(cached_val).__name__
print 'val=%s' % repr(cached_val)
```

I expected to get back:

```
type=unicode
val=u'Copyright \xa9 2012'
```

Instead, using either HiredisParser or PythonParser, values saved as unicode using charset='utf-8', get returned as `str`:

```
type=str
val='Copyright \xc2\xa9 2012'
```