无法编码存储在azure数据库中

时间:2017-07-06 14:40:03

标签: azure encoding python-unicode

我有一个带有 collat​​ion = SQL_Latin1_General_CP1_CI_AS 的Azure sql server。我想存储一些unicode character =代码点为 u'\ U0001f381'。 我在ubuntu 14.04 LTS上使用python 2.7.11。

当我使用'utf-8'编码时,如

u'\U0001f381'.encode('utf-8')                                                                       

它在azure数据库中被保存为楧瑦躟。在将数据推送到数据库之前,我不确定应该使用哪种编码。我猜测,因为我的azure数据库的排序规则为 SQL_Latin1_General_CP1_CI_AS ,我应该使用其他一些编码。 提前谢谢。

0 个答案:

没有答案