mirror of
https://github.com/ultrajson/ultrajson.git
synced 2024-11-24 01:04:19 +01:00
- Fixed issue with parsing kwargs
- Fixed test for ensure_ascii - Bumped version - Fixed / decoding issue in lookup tables
This commit is contained in:
parent
0e940b15e0
commit
daf0fde4c9
@ -664,7 +664,7 @@ char *Object_iterGetName(JSOBJ obj, JSONTypeContext *tc, size_t *outLen)
|
||||
|
||||
PyObject* objToJSON(PyObject* self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "ensure_ascii", NULL};
|
||||
static char *kwlist[] = { "obj", "ensure_ascii", NULL};
|
||||
|
||||
char buffer[65536];
|
||||
char *ret;
|
||||
@ -698,7 +698,7 @@ PyObject* objToJSON(PyObject* self, PyObject *args, PyObject *kwargs)
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O", kwlist, &oinput, &oensureAscii))
|
||||
{
|
||||
return PyErr_Format(PyExc_TypeError, "Expected object, **kw ensure_ascii true/false");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (oensureAscii != NULL && !PyObject_IsTrue(oensureAscii))
|
||||
|
@ -217,9 +217,9 @@ class UltraJSONTests(TestCase):
|
||||
|
||||
def test_encodeToUTF8(self):
|
||||
input = "\xe6\x97\xa5\xd1\x88"
|
||||
enc = ujson.encode(input, ensure_ascii=false)
|
||||
enc = ujson.encode(input, ensure_ascii=False)
|
||||
dec = ujson.decode(enc)
|
||||
self.assertEquals(enc, json.dumps(input, encoding="utf-8"))
|
||||
self.assertEquals(enc, json.dumps(input, encoding="utf-8", ensure_ascii=False))
|
||||
self.assertEquals(dec, json.loads(enc))
|
||||
|
||||
|
||||
|
@ -1 +1 @@
|
||||
#define UJSON_VERSION "1.7"
|
||||
#define UJSON_VERSION "1.8"
|
||||
|
@ -65,7 +65,7 @@ static const JSUINT8 g_asciiOutputTable[256] =
|
||||
{
|
||||
/* 0x00 */ 0, 30, 30, 30, 30, 30, 30, 30, 10, 12, 14, 30, 16, 18, 30, 30,
|
||||
/* 0x10 */ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
|
||||
/* 0x20 */ 1, 1, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 24,
|
||||
/* 0x20 */ 1, 1, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1/*24*/,
|
||||
/* 0x30 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 0x40 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 0x50 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 22, 1, 1, 1,
|
||||
|
Loading…
Reference in New Issue
Block a user