Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
Added charset support to utf8mb4.
Browse files Browse the repository at this point in the history
  • Loading branch information
Leechael committed Aug 7, 2013
1 parent 89f13a2 commit c19bc1c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions python/umysql.c
Expand Up @@ -847,9 +847,15 @@ PyObject *Connection_connect(Connection *self, PyObject *args)
self->PFN_PyUnicode_Encode = PyUnicode_EncodeCP1250Helper;
}
else
{
return PyErr_Format (PyExc_ValueError, "Unsupported character set '%s' specified", pstrCharset);
}
if (strcmp (pstrCharset, "utf8mb4") == 0)
{
self->charset = MCS_utf8mb4_general_ci;
self->PFN_PyUnicode_Encode = PyUnicode_EncodeUTF8;
}
else
{
return PyErr_Format (PyExc_ValueError, "Unsupported character set '%s' specified", pstrCharset);
}
}
else
{
Expand Down

0 comments on commit c19bc1c

Please sign in to comment.