simplejson/simplejson — Issue #25: Different encoding with and without speedups
Author: MofX
Created: 2011-12-07 10:02:31+00:00
State: open

Hi,

we just ran into an issue with the encodings when speedups are enabled and when they are not.
When speedups aren't enabled a JSON string is always returned as a unicode python string.
With speedups enabled it depends on the JSON input.

With speedups:
```python
type(simplejson.loads('"abc"')) = "str"
type(simplejson.loads(u'"abc"')) = "unicode"
type(simplejson.loads(u'"abc"'.encode("utf-8"))) = "str"
type(simplejson.loads(u'"\xf6"'.encode("utf-8"))) = "unicode"
```

The same without speedups results in unicode all the time.